[PATCH] D129369: Force alignment to fix build failure on z/OS.
Abhina Sree via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 06:41:46 PDT 2022
abhina.sreeskantharajan created this revision.
Herald added a project: All.
abhina.sreeskantharajan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D129369
Files:
llvm/include/llvm/IR/Metadata.h
Index: llvm/include/llvm/IR/Metadata.h
===================================================================
--- llvm/include/llvm/IR/Metadata.h
+++ llvm/include/llvm/IR/Metadata.h
@@ -952,7 +952,9 @@
/// For resizable MDNodes, the space for the storage vector is also allocated
/// immediately before the header, overlapping with the operands.
struct Header {
- bool IsResizable : 1;
+ // Explicity set alignment on z/OS because bitfields by default
+ // have an alignment of 1.
+ bool IsResizable [[gnu::aligned(alignof(size_t))]] : 1;
bool IsLarge : 1;
size_t SmallSize : 4;
size_t SmallNumOps : 4;
@@ -1032,6 +1034,9 @@
}
};
+ static_assert(__builtin_offsetof(Header, NumUnresolved) == sizeof(size_t),
+ "NumUnresolved offset is incorrect");
+
Header &getHeader() { return *(reinterpret_cast<Header *>(this) - 1); }
const Header &getHeader() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129369.443235.patch
Type: text/x-patch
Size: 922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220708/00761120/attachment.bin>
More information about the llvm-commits
mailing list