[PATCH] D108858: TypeInfo records more information about align requirement

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 27 23:19:16 PDT 2021


rjmccall added a comment.

Thanks.  Generally looks good; feel free to commit after adding a `RequiredByEnum` case and making sure it compiles.



================
Comment at: clang/lib/AST/ASTContext.cpp:2300
         Info.Align = AttrAlign;
-        Info.AlignIsRequired = true;
+        Info.AlignRequirement = AlignRequirementKind::RequiredByRecord;
       }
----------------
Oh, I guess "record" is imprecise here.  We might as well add a `RequiredByEnum` case, then, just to be fully accurate; there's no real harm to it.


================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1981
   CharUnits PreferredAlign = FieldAlign;
-  if (DefaultsToAIXPowerAlignment && !AlignIsRequired &&
+  if (DefaultsToAIXPowerAlignment && !isAlignRequired() &&
       (FoundFirstNonOverlappingEmptyFieldForAIX || IsNaturalAlign)) {
----------------
Bug here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108858



More information about the cfe-commits mailing list