@@ -2691,6 +2691,11 @@ void Verifier::visitFunction(const Function &F) {
2691
2691
Check (verifyAttributeCount (Attrs, FT->getNumParams ()),
2692
2692
" Attribute after last parameter!" , &F);
2693
2693
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
+
2694
2699
bool IsIntrinsic = F.isIntrinsic ();
2695
2700
2696
2701
// Check function attributes.
@@ -3034,6 +3039,11 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
3034
3039
Check (I.getParent () == &BB, " Instruction has bogus parent pointer!" );
3035
3040
}
3036
3041
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
+
3037
3047
// Confirm that no issues arise from the debug program.
3038
3048
if (BB.IsNewDbgInfoFormat )
3039
3049
CheckDI (!BB.getTrailingDPValues (), " Basic Block has trailing DbgRecords!" ,
0 commit comments