aboutsummaryrefslogtreecommitdiff
path: root/tools/opt/opt.cpp
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
commit29012319cd1a6dee716c3149ead614a8271f7338 (patch)
treeff8fcf5fa815eea72136fbf13f05954c68bdd8da /tools/opt/opt.cpp
parent98bec51b35382ab1682e31818e46bc165ea74142 (diff)
Print breakpoints for call instructions. This is used by optimized debug info test harness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index c1e0ad128b..85d365306a 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<CallInst>(BI)) {
+ const DebugLoc DL = CI->getDebugLoc();
+ if (!DL.isUnknown()) {
+ DIScope S(DL.getScope(getGlobalContext()));
+ Out << S.getFilename() << " " << DL.getLine() << "\n";
+ }
+ }
+ }
return false;
}