ro added a comment.

In D130688#3686512 <https://reviews.llvm.org/D130688#3686512>, @MaskRay wrote:

> Making the behavior different for different Linux distributions is not great, 
> but if it matches the practice, I think it is fine.

It's the best we can do in `clang`, I fear, due to the compiler's desire to 
decide as much as possible at runtime.  GCC is way more static here, and 
whoever builds it can decide on the default CPU with `--with-cpu=v9` e.g. at 
configure time.

> I don't know Sparc enough to suggest anything for 32-bit, though...

An alternative would be to just check the host CPU with `getHostCPUName` as 
updated by D130272 <https://reviews.llvm.org/D130272>.  That CPU name then 
needs to be checked if it supports the V9 ISA.  That could be done using 
`getCPUGeneration(CPU) == CG_V9` in `clang/lib/Basic/Targets/Sparc.h`.  
However, `SparcTargetInfo` (or `TargetInfo` in general) is not currently used 
inside the driver code.

Of course, this only works in the native case, but that's true for distro 
checks, too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130688/new/

https://reviews.llvm.org/D130688

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D130688:... Fangrui Song via Phabricator via cfe-commits
    • [PATCH] D13... Rainer Orth via Phabricator via cfe-commits
    • [PATCH] D13... Rainer Orth via Phabricator via cfe-commits
    • [PATCH] D13... John Paul Adrian Glaubitz via Phabricator via cfe-commits
    • [PATCH] D13... Rainer Orth via Phabricator via cfe-commits
    • [PATCH] D13... John Paul Adrian Glaubitz via Phabricator via cfe-commits
    • [PATCH] D13... Rainer Orth via Phabricator via cfe-commits

Reply via email to