- if (VerifyDebugInfo) {
- for (DICompileUnit CU : Finder.compile_units()) {
- Assert1(CU.Verify(), "DICompileUnit does not Verify!", CU);
- }
- for (DISubprogram S : Finder.subprograms()) {
- Assert1(S.Verify(), "DISubprogram does not Verify!", S);
- }
- for (DIGlobalVariable GV : Finder.global_variables()) {
- Assert1(GV.Verify(), "DIGlobalVariable does not Verify!", GV);
- }
- for (DIType T : Finder.types()) {
- Assert1(T.Verify(), "DIType does not Verify!", T);
- }
- for (DIScope S : Finder.scopes()) {
- Assert1(S.Verify(), "DIScope does not Verify!", S);
+ for (DICompileUnit CU : Finder.compile_units())
+ Assert1(CU.Verify(), "DICompileUnit does not Verify!", CU);
+ for (DISubprogram S : Finder.subprograms())
+ Assert1(S.Verify(), "DISubprogram does not Verify!", S);
+ for (DIGlobalVariable GV : Finder.global_variables())
+ Assert1(GV.Verify(), "DIGlobalVariable does not Verify!", GV);
+ for (DIType T : Finder.types())
+ Assert1(T.Verify(), "DIType does not Verify!", T);
+ for (DIScope S : Finder.scopes())
+ Assert1(S.Verify(), "DIScope does not Verify!", S);
+}
+
+void DebugInfoVerifier::processInstructions(DebugInfoFinder &Finder) {
+ for (const Function &F : *M)
+ for (auto I = inst_begin(&F), E = inst_end(&F); I != E; ++I) {
+ if (MDNode *MD = I->getMetadata(LLVMContext::MD_dbg))
+ Finder.processLocation(*M, DILocation(MD));
+ if (const CallInst *CI = dyn_cast<CallInst>(&*I))
+ processCallInst(Finder, *CI);