[PATCH] D86790: [FE] Use preferred alignment instead of ABI alignment for complete object when applicable

Xiangling Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 8 07:04:44 PDT 2020


Xiangling_L added a comment.

In D86790#2255371 <https://reviews.llvm.org/D86790#2255371>, @jyknight wrote:

> Do you have open questions on whether some callsites passing "false" here, should be switched to true? Given what's here, I would say that it definitely does not makes sense to add this parameter everywhere.

Basically, the places where I changed to `true /* NeedsPreferredAlignment */` are ones I'd like reviewers to see if the switch is correct.



================
Comment at: clang/lib/CodeGen/CGAtomic.cpp:814
+  std::tie(sizeChars, alignChars) = getContext().getTypeInfoInChars(
+      AtomicTy, true /* NeedsPreferredAlignment */);
   uint64_t Size = sizeChars.getQuantity();
----------------
jyknight wrote:
> This is wrong.
Can you explain a bit why it's wrong?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86790



More information about the cfe-commits mailing list