[llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)
Jessica Clarke via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 08:27:30 PST 2025
================
@@ -2398,17 +2398,23 @@ void AsmPrinter::emitRemarksSection(remarks::RemarkStreamer &RS) {
OutStreamer->emitBinaryData(Buf);
}
-static void tagGlobalDefinition(Module &M, GlobalVariable *G) {
- Constant *Initializer = G->getInitializer();
+static uint64_t globalSize(const GlobalVariable &G) {
+ const Constant *Initializer = G.getInitializer();
uint64_t SizeInBytes =
- M.getDataLayout().getTypeAllocSize(Initializer->getType());
+ G.getParent()->getDataLayout().getTypeAllocSize(Initializer->getType());
- uint64_t NewSize = alignTo(SizeInBytes, 16);
- if (SizeInBytes != NewSize) {
+ return SizeInBytes;
+}
+
+static void tagGlobalDefinition(GlobalVariable *G) {
----------------
jrtc27 wrote:
Needs a more generic name
https://github.com/llvm/llvm-project/pull/121957
More information about the llvm-commits
mailing list