diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index c1e0ad128bc..85d365306a2 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -364,6 +364,19 @@ struct BreakpointPrinter : public FunctionPass { } while (BI != I->begin()); break; } + BasicBlock &EntryBB = F.getEntryBlock(); + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) { + BasicBlock *BB = I; + if (BB == &EntryBB) continue; + for (BasicBlock::iterator BI = I->begin(), BE = I->end(); BI != BE; ++BI) + if (CallInst *CI = dyn_cast(BI)) { + const DebugLoc DL = CI->getDebugLoc(); + if (!DL.isUnknown()) { + DIScope S(DL.getScope(getGlobalContext())); + Out << S.getFilename() << " " << DL.getLine() << "\n"; + } + } + } return false; }