aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-02 20:44:29 +0000
committerChris Lattner <sabre@nondot.org>2010-04-02 20:44:29 +0000
commit28a9bf67e220db14d29d60a5a4bea3f8cb2f7316 (patch)
tree616f7010e1aeee377c850732ffbfc3c7999fa654 /lib/Analysis
parent42f95ca96b4dc252d334426729113d54c95f092a (diff)
downloadexternal_llvm-28a9bf67e220db14d29d60a5a4bea3f8cb2f7316.zip
external_llvm-28a9bf67e220db14d29d60a5a4bea3f8cb2f7316.tar.gz
external_llvm-28a9bf67e220db14d29d60a5a4bea3f8cb2f7316.tar.bz2
DebugInfoFinder::processModule was foiling my plot by
materializing an MDNode for every debugloc. don't do that! :) "clang -g -S t.c" really no longer makes mdnodes for location tuples now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DebugInfo.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 0bafd65..8ba1902 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -1146,16 +1146,31 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset,
/// processModule - Process entire module and collect debug info.
void DebugInfoFinder::processModule(Module &M) {
- unsigned MDDbgKind = M.getMDKindID("dbg");
-
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI)
for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE;
++BI) {
- if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI))
+ if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) {
processDeclare(DDI);
- else if (MDNode *L = BI->getMetadata(MDDbgKind))
- processLocation(DILocation(L));
+ continue;
+ }
+
+ DebugLoc Loc = BI->getDebugLoc();
+ if (Loc.isUnknown())
+ continue;
+
+ LLVMContext &Ctx = BI->getContext();
+ DIDescriptor Scope(Loc.getScope(Ctx));
+
+ if (Scope.isCompileUnit())
+ addCompileUnit(DICompileUnit(Scope.getNode()));
+ else if (Scope.isSubprogram())
+ processSubprogram(DISubprogram(Scope.getNode()));
+ else if (Scope.isLexicalBlock())
+ processLexicalBlock(DILexicalBlock(Scope.getNode()));
+
+ if (MDNode *IA = Loc.getInlinedAt(Ctx))
+ processLocation(DILocation(IA));
}
NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv");