@@ -3185,12 +3185,6 @@ void Verifier::visitFunction(const Function &F) {
31853185 CheckDI (SP->describes (&F),
31863186 " !dbg attachment points at wrong subprogram for function" , N, &F,
31873187 &I, DL, Scope, SP);
3188-
3189- if (DL->getAtomGroup ())
3190- CheckDI (DL->getScope ()->getSubprogram ()->getKeyInstructionsEnabled (),
3191- " DbgLoc uses atomGroup but DISubprogram doesn't have Key "
3192- " Instructions enabled" ,
3193- DL, DL->getScope ()->getSubprogram ());
31943188 };
31953189 for (auto &BB : F)
31963190 for (auto &I : BB) {
@@ -5492,6 +5486,13 @@ void Verifier::visitInstruction(Instruction &I) {
54925486 if (MDNode *N = I.getDebugLoc ().getAsMDNode ()) {
54935487 CheckDI (isa<DILocation>(N), " invalid !dbg metadata attachment" , &I, N);
54945488 visitMDNode (*N, AreDebugLocsAllowed::Yes);
5489+
5490+ auto *DL = cast<DILocation>(N);
5491+ if (DL->getAtomGroup ())
5492+ CheckDI (DL->getScope ()->getSubprogram ()->getKeyInstructionsEnabled (),
5493+ " DbgLoc uses atomGroup but DISubprogram doesn't have Key "
5494+ " Instructions enabled" ,
5495+ DL, DL->getScope ()->getSubprogram ());
54955496 }
54965497
54975498 if (auto *DII = dyn_cast<DbgVariableIntrinsic>(&I)) {
0 commit comments