[PATCH] D87702: [Frontend] Add pragma align natural and sort out pragma pack stack effect

Xiangling Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 25 07:51:31 PST 2020


Xiangling_L added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:637
   PragmaStack<MSVtorDispMode> VtorDispStack;
-  // #pragma pack.
-  // Sentinel to represent when the stack is set to mac68k alignment.
-  static const unsigned kMac68kAlignmentSentinel = ~0U;
-  PragmaStack<unsigned> PackStack;
+  PragmaStack<AlignPackInfo> PackStack;
   // The current #pragma pack values and locations at each #include.
----------------
jasonliu wrote:
> We should consider renaming PackStack to AlignPackStack across Clang. Maybe even as a NFC first. As it is right now, clang already uses one stack to record those two informations from `Pragma align` and `Pragma pack`. Leave it as PackStack is too confusing, and people could actually ignore the pragma Align when developing with PackStack. 
That's a good point. I will create a NFC accordingly.


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

https://reviews.llvm.org/D87702



More information about the cfe-commits mailing list