@@ -2691,6 +2691,11 @@ void Verifier::visitFunction(const Function &F) {
26912691 Check (verifyAttributeCount (Attrs, FT->getNumParams ()),
26922692 " Attribute after last parameter!" , &F);
26932693
2694+ CheckDI (F.IsNewDbgInfoFormat == F.getParent ()->IsNewDbgInfoFormat ,
2695+ " Function debug format should match parent module" , &F,
2696+ F.IsNewDbgInfoFormat , F.getParent (),
2697+ F.getParent ()->IsNewDbgInfoFormat );
2698+
26942699 bool IsIntrinsic = F.isIntrinsic ();
26952700
26962701 // Check function attributes.
@@ -3034,6 +3039,11 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
30343039 Check (I.getParent () == &BB, " Instruction has bogus parent pointer!" );
30353040 }
30363041
3042+ CheckDI (BB.IsNewDbgInfoFormat == BB.getParent ()->IsNewDbgInfoFormat ,
3043+ " BB debug format should match parent function" , &BB,
3044+ BB.IsNewDbgInfoFormat , BB.getParent (),
3045+ BB.getParent ()->IsNewDbgInfoFormat );
3046+
30373047 // Confirm that no issues arise from the debug program.
30383048 if (BB.IsNewDbgInfoFormat )
30393049 CheckDI (!BB.getTrailingDPValues (), " Basic Block has trailing DbgRecords!" ,
0 commit comments