[clang][modules] Over-align the `Module` class
authorJan Svoboda <jan_svoboda@apple.com>
Mon, 26 Sep 2022 16:40:02 +0000 (09:40 -0700)
committerJan Svoboda <jan_svoboda@apple.com>
Mon, 26 Sep 2022 17:55:22 +0000 (10:55 -0700)
This makes `llvm::PointerIntPair<Module *, 3>` from f35230ae work across platforms.

Reviewed By: srj

Differential Revision: https://reviews.llvm.org/D134653

clang/include/clang/Basic/Module.h

index 1a1feb9..5f8882e 100644 (file)
@@ -93,7 +93,9 @@ struct ASTFileSignature : std::array<uint8_t, 20> {
 };
 
 /// Describes a module or submodule.
-class Module {
+///
+/// Aligned to 8 bytes to allow for llvm::PointerIntPair<Module *, 3>.
+class alignas(8) Module {
 public:
   /// The name of this module.
   std::string Name;