mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-06 04:09:04 +00:00
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. llvm-svn: 100224
This commit is contained in:
parent
9da2b8a955
commit
abbd9ae4d3
@ -1146,16 +1146,31 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset,
|
|||||||
|
|
||||||
/// processModule - Process entire module and collect debug info.
|
/// processModule - Process entire module and collect debug info.
|
||||||
void DebugInfoFinder::processModule(Module &M) {
|
void DebugInfoFinder::processModule(Module &M) {
|
||||||
unsigned MDDbgKind = M.getMDKindID("dbg");
|
|
||||||
|
|
||||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
|
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 (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI)
|
||||||
for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE;
|
for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE;
|
||||||
++BI) {
|
++BI) {
|
||||||
if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI))
|
if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) {
|
||||||
processDeclare(DDI);
|
processDeclare(DDI);
|
||||||
else if (MDNode *L = BI->getMetadata(MDDbgKind))
|
continue;
|
||||||
processLocation(DILocation(L));
|
}
|
||||||
|
|
||||||
|
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");
|
NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.gv");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user