aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2024-12-17 00:47:02 -0800
committerGitHub <noreply@github.com>2024-12-17 00:47:02 -0800
commit514580b43898921cc95659de47b383bd2c9b4b12 (patch)
tree5794033a70b8ba68c600ebf727c4dfb980bedccf /llvm/lib/IR/Verifier.cpp
parent58cfa39861bfbb6605df1480a3068ea7fc737d4d (diff)
downloadllvm-514580b43898921cc95659de47b383bd2c9b4b12.zip
llvm-514580b43898921cc95659de47b383bd2c9b4b12.tar.gz
llvm-514580b43898921cc95659de47b383bd2c9b4b12.tar.bz2
[MTE] Apply alignment / size in AsmPrinter rather than IR (#111918)
This makes sure no optimizations are applied that assume the bigger alignment or size, which could be incorrect if we link together with non-instrumented code.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 55de486..48e2776 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -808,6 +808,10 @@ void Verifier::visitGlobalValue(const GlobalValue &GV) {
"visibility must be dso_local!",
&GV);
+ if (GV.isTagged()) {
+ Check(!GV.hasSection(), "tagged GlobalValue must not be in section.", &GV);
+ }
+
forEachUser(&GV, GlobalValueVisited, [&](const Value *V) -> bool {
if (const Instruction *I = dyn_cast<Instruction>(V)) {
if (!I->getParent() || !I->getParent()->getParent())