[clang] 715bd12 - [clang][modules] Over-align the `Module` class

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 10:55:49 PDT 2022


Author: Jan Svoboda
Date: 2022-09-26T10:55:22-07:00
New Revision: 715bd12d2e1d4373b58ce515a6e2923d9b617226

URL: https://github.com/llvm/llvm-project/commit/715bd12d2e1d4373b58ce515a6e2923d9b617226
DIFF: https://github.com/llvm/llvm-project/commit/715bd12d2e1d4373b58ce515a6e2923d9b617226.diff

LOG: [clang][modules] Over-align the `Module` class

This makes `llvm::PointerIntPair<Module *, 3>` from f35230ae work across platforms.

Reviewed By: srj

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

Added: 
    

Modified: 
    clang/include/clang/Basic/Module.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h
index 1a1feb9d4d3f3..5f8882e4a00d5 100644
--- a/clang/include/clang/Basic/Module.h
+++ b/clang/include/clang/Basic/Module.h
@@ -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;


        


More information about the cfe-commits mailing list