diff options
author | Devang Patel <dpatel@apple.com> | 2011-01-31 21:36:24 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-01-31 21:36:24 +0000 |
commit | 97f6d5b24136ac19d5f83c1ee9541b05f0eccebd (patch) | |
tree | 93285817b8de4a1208c0868c6419bc5fe61fe887 /tools/opt/opt.cpp | |
parent | bb6d14fbfe9b665aff5778e0eaecaabacfaf0bcc (diff) | |
download | external_llvm-97f6d5b24136ac19d5f83c1ee9541b05f0eccebd.zip external_llvm-97f6d5b24136ac19d5f83c1ee9541b05f0eccebd.tar.gz external_llvm-97f6d5b24136ac19d5f83c1ee9541b05f0eccebd.tar.bz2 |
While printing "interesting" breakpoint locations for debug info quality test harness, focus only on entry block's terminator for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r-- | tools/opt/opt.cpp | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index ff8f65c..64c08ab 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -349,34 +349,19 @@ struct BreakpointPrinter : public FunctionPass { } 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; } |