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

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 10:31:37 PDT 2022


jansvoboda11 updated this revision to Diff 462965.
jansvoboda11 added a comment.

Document reason for `alignas`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134653

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


Index: clang/include/clang/Basic/Module.h
===================================================================
--- clang/include/clang/Basic/Module.h
+++ clang/include/clang/Basic/Module.h
@@ -93,7 +93,9 @@
 };
 
 /// 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134653.462965.patch
Type: text/x-patch
Size: 432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220926/47c894d0/attachment-0001.bin>


More information about the cfe-commits mailing list