[PATCH] D43734: [RecordLayout] Don't align to non-power-of-2 sizes when using -mms-bitfields

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 24 14:47:57 PST 2018


compnerd added inline comments.


================
Comment at: lib/AST/RecordLayoutBuilder.cpp:1755
         CharUnits TypeSize = Context.getTypeSizeInChars(BTy);
-        if (TypeSize > FieldAlign)
+        if (TypeSize > FieldAlign &&
+            llvm::isPowerOf2_64(TypeSize.getQuantity()))
----------------
Can you add an assertion that the size is a power of two unless it is the GNU environment?


Repository:
  rC Clang

https://reviews.llvm.org/D43734





More information about the cfe-commits mailing list