aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-06-30 08:01:55 +0100
committerGitHub <noreply@github.com>2025-06-30 08:01:55 +0100
commit140e1894f245896752d06a7f5c405a465b492e73 (patch)
treec822251b6651cca627b73698e566ae516ff3e33d /llvm/lib/IR/Verifier.cpp
parent629126ed44bd3ce5b6f476459c805be4e4e0c2ca (diff)
downloadllvm-140e1894f245896752d06a7f5c405a465b492e73.zip
llvm-140e1894f245896752d06a7f5c405a465b492e73.tar.gz
llvm-140e1894f245896752d06a7f5c405a465b492e73.tar.bz2
[KeyInstr] Add DISubprogram::keyInstructions bit (#144107)
Patch 1/4 adding bitcode support. Store whether or not a function is using Key Instructions in its DISubprogram so that we don't need to rely on the -mllvm flag -dwarf-use-key-instructions to determine whether or not to interpret Key Instructions metadata to decide is_stmt placement at DWARF emission time. This makes bitcode support simple and enables well defined mixing of non-key-instructions and key-instructions functions in an LTO context. This patch adds the bit (using DISubprogram::SubclassData1). PR 144104 and 144103 use it during DWARF emission. PR 44102 adds bitcode support. See pull request for overview of alternative attempts.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 9cab88b..96eb4ef 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3178,6 +3178,12 @@ void Verifier::visitFunction(const Function &F) {
CheckDI(SP->describes(&F),
"!dbg attachment points at wrong subprogram for function", N, &F,
&I, DL, Scope, SP);
+
+ if (DL->getAtomGroup())
+ CheckDI(DL->getScope()->getSubprogram()->getKeyInstructionsEnabled(),
+ "DbgLoc uses atomGroup but DISubprogram doesn't have Key "
+ "Instructions enabled",
+ DL, DL->getScope()->getSubprogram());
};
for (auto &BB : F)
for (auto &I : BB) {