summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-12-09 23:37:07 +0000
committerDevang Patel <dpatel@apple.com>2010-12-09 23:37:07 +0000
commit197df5c9c82b0de2af9b2745ae1121256ce730e0 (patch)
treed06a5adbd8b5f9b1ebb0c807ee4ed39dfa05a7b0 /llvm/tools
parent9c7bd2f535b1f598f14b85880f1deffef886af2f (diff)
downloadbcm5719-llvm-197df5c9c82b0de2af9b2745ae1121256ce730e0.tar.gz
bcm5719-llvm-197df5c9c82b0de2af9b2745ae1121256ce730e0.zip
Print breakpoints for call instructions. This is used by optimized debug info test harness.
llvm-svn: 121432
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/opt/opt.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index c1e0ad128bc..85d365306a2 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/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<CallInst>(BI)) {
+ const DebugLoc DL = CI->getDebugLoc();
+ if (!DL.isUnknown()) {
+ DIScope S(DL.getScope(getGlobalContext()));
+ Out << S.getFilename() << " " << DL.getLine() << "\n";
+ }
+ }
+ }
return false;
}
OpenPOWER on IntegriCloud