+void Verifier::verifyDebugInfo(Module &M) {
+ // Verify Debug Info.
+ if (!DisableDebugInfoVerifier) {
+ DebugInfoFinder Finder;
+ Finder.processModule(M);
+
+ for (DebugInfoFinder::iterator I = Finder.compile_unit_begin(),
+ E = Finder.compile_unit_end(); I != E; ++I)
+ Assert1(DICompileUnit(*I).Verify(), "DICompileUnit does not Verify!", *I);
+ for (DebugInfoFinder::iterator I = Finder.subprogram_begin(),
+ E = Finder.subprogram_end(); I != E; ++I)
+ Assert1(DISubprogram(*I).Verify(), "DISubprogram does not Verify!", *I);
+ for (DebugInfoFinder::iterator I = Finder.global_variable_begin(),
+ E = Finder.global_variable_end(); I != E; ++I)
+ Assert1(DIGlobalVariable(*I).Verify(),
+ "DIGlobalVariable does not Verify!", *I);
+ for (DebugInfoFinder::iterator I = Finder.type_begin(),
+ E = Finder.type_end(); I != E; ++I)
+ Assert1(DIType(*I).Verify(), "DIType does not Verify!", *I);
+ }
+}
+