[llvm-commits] [llvm] r124610 - /llvm/trunk/tools/opt/opt.cpp
Devang Patel
dpatel at apple.com
Mon Jan 31 13:36:24 PST 2011
Author: dpatel
Date: Mon Jan 31 15:36:24 2011
New Revision: 124610
URL: http://llvm.org/viewvc/llvm-project?rev=124610&view=rev
Log:
While printing "interesting" breakpoint locations for debug info quality test harness, focus only on entry block's terminator for now.
Modified:
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=124610&r1=124609&r2=124610&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Mon Jan 31 15:36:24 2011
@@ -349,34 +349,19 @@
}
virtual bool runOnFunction(Function &F) {
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
- BasicBlock::const_iterator BI = I->end();
- --BI;
- do {
- const Instruction *In = BI;
- const DebugLoc DL = In->getDebugLoc();
- if (!DL.isUnknown()) {
- DIScope S(DL.getScope(getGlobalContext()));
- Out << S.getFilename() << " " << DL.getLine() << "\n";
- break;
- }
- --BI;
- } 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<CallInst>(BI)) {
- const DebugLoc DL = CI->getDebugLoc();
- if (!DL.isUnknown()) {
- DIScope S(DL.getScope(getGlobalContext()));
- Out << S.getFilename() << " " << DL.getLine() << "\n";
- }
- }
- }
+ BasicBlock::const_iterator BI = EntryBB.end();
+ --BI;
+ do {
+ const Instruction *In = BI;
+ const DebugLoc DL = In->getDebugLoc();
+ if (!DL.isUnknown()) {
+ DIScope S(DL.getScope(getGlobalContext()));
+ Out << S.getFilename() << " " << DL.getLine() << "\n";
+ break;
+ }
+ --BI;
+ } while (BI != EntryBB.begin());
return false;
}
More information about the llvm-commits
mailing list