[PATCH] D135326: Half-done attempt to move tail padding callback from TargetCXXABI to TargetInfo

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 13:35:24 PDT 2022


dblaikie added inline comments.


================
Comment at: clang/lib/Basic/Targets/OSTargets.h:169
+    if (T.getOS() == llvm::Triple::WatchOS ||
+        this->getCXXABI().getKind() == TargetCXXABI::AppleARM64)
+      return TargetInfo::UseTailPaddingUnlessPOD11;
----------------
dblaikie wrote:
> rnk wrote:
> > I think it would be equivalent to check `T.getArch() == llvm::Triple::AArch64`, that's probably what set the TargetCXXABI.
> Hmm, seems one of the tests failed because apparently CXXABI can be chosen separately from target. `clang/test/CodeGenCXX/armv7k.cpp` for instance runs with `-triple=arm64_32-apple-ios -emit-llvm -target-abi darwinpcs`
> 
> Which seems to have an UnknownOS on the triple, but a WatchOS on the TargetCXXABI... (I don't really understand/haven't looked into how all these things relate to the command line arguments there - none of it mentions WatchOS, but maybe `darwinpcs` is the name of watchOS?
> 
> Updating this function to inspect the CXXABI for WatchOS, AppleARM64, and iOS (which I'd missed from here previously) here makes the tests pass... 
> 
> Maybe that suggests we should move all this (& the D119051) to TargetCXXABI?
I guess if this version is going to defer entirely to the CXXABI then presumably the other implementations of `getTailPaddingUseRules` should do that too - or all of this is to say maybe this property should stay in the ABI? & we should add the DefaultedSMFArePOD property to TargetCXXABI, instead of TargetInfo?

(all that said, I am somewhat confused by what an "OS" is, if it's not an ABI? What does it mean to use one OS but a different ABI? What features of the OS persist in that case? I can't think of any, but don't know much about these things)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135326



More information about the cfe-commits mailing list