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 | b07ec831cfd5a924367d7640217757c7c4829232 (patch) | |
tree | f9584a36d72e4aae2c72d354401eb9c5ccd2aa21 | |
parent | dd88dbf9d2b342cf2ce7a9d093033adf95475d46 (diff) | |
download | bcm5719-llvm-b07ec831cfd5a924367d7640217757c7c4829232.tar.gz bcm5719-llvm-b07ec831cfd5a924367d7640217757c7c4829232.zip |
While printing "interesting" breakpoint locations for debug info quality test harness, focus only on entry block's terminator for now.
llvm-svn: 124610
-rw-r--r-- | llvm/tools/opt/opt.cpp | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index ff8f65cfff7..64c08ab56af 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/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; } |