[clang] [llvm] [KeyInstr] Fix verifier check (PR #149043)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 16 02:39:34 PDT 2025
================
@@ -5492,6 +5486,14 @@ void Verifier::visitInstruction(Instruction &I) {
if (MDNode *N = I.getDebugLoc().getAsMDNode()) {
CheckDI(isa<DILocation>(N), "invalid !dbg metadata attachment", &I, N);
visitMDNode(*N, AreDebugLocsAllowed::Yes);
+
+ if (auto *DL = dyn_cast<DILocation>(N)) {
+ if (DL->getAtomGroup())
+ CheckDI(DL->getScope()->getSubprogram()->getKeyInstructionsEnabled(),
+ "DbgLoc uses atomGroup but DISubprogram doesn't have Key "
+ "Instructions enabled",
+ DL, DL->getScope()->getSubprogram());
----------------
SLTozer wrote:
Nit, braces.
https://github.com/llvm/llvm-project/pull/149043
More information about the llvm-commits
mailing list