forked from OSchip/llvm-project
Do not get confused by multiple empty lexical scopes inlined at one location.
llvm-svn: 135232
This commit is contained in:
parent
c41d4fe243
commit
001c4f3ff0
|
@ -1587,18 +1587,22 @@ DbgScope *DwarfDebug::getOrCreateDbgScope(DebugLoc DL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrCreateAbstractScope(Scope);
|
getOrCreateAbstractScope(Scope);
|
||||||
DbgScope *WScope = DbgScopeMap.lookup(InlinedAt);
|
DbgScope *WScope = NULL;
|
||||||
|
const MDNode *Key = InlinedAt;
|
||||||
|
if (const MDNode *Nest = DILocation(InlinedAt).getOrigLocation())
|
||||||
|
Key = Nest;
|
||||||
|
WScope = DbgScopeMap.lookup(Key);
|
||||||
if (WScope)
|
if (WScope)
|
||||||
return WScope;
|
return WScope;
|
||||||
|
|
||||||
WScope = new DbgScope(NULL, DIDescriptor(Scope), InlinedAt);
|
WScope = new DbgScope(NULL, DIDescriptor(Scope), InlinedAt);
|
||||||
DbgScopeMap.insert(std::make_pair(InlinedAt, WScope));
|
DbgScopeMap[Key] = WScope;
|
||||||
DbgScope *Parent =
|
DbgScope *Parent =
|
||||||
getOrCreateDbgScope(DebugLoc::getFromDILocation(InlinedAt));
|
getOrCreateDbgScope(DebugLoc::getFromDILocation(InlinedAt));
|
||||||
WScope->setParent(Parent);
|
WScope->setParent(Parent);
|
||||||
Parent->addScope(WScope);
|
Parent->addScope(WScope);
|
||||||
|
|
||||||
ConcreteScopes[InlinedAt] = WScope;
|
ConcreteScopes[Key] = WScope;
|
||||||
|
|
||||||
return WScope;
|
return WScope;
|
||||||
}
|
}
|
||||||
|
@ -2083,8 +2087,12 @@ DbgScope *DwarfDebug::findDbgScope(DebugLoc DL) {
|
||||||
|
|
||||||
DbgScope *Scope = NULL;
|
DbgScope *Scope = NULL;
|
||||||
LLVMContext &Ctx = Asm->MF->getFunction()->getContext();
|
LLVMContext &Ctx = Asm->MF->getFunction()->getContext();
|
||||||
if (const MDNode *IA = DL.getInlinedAt(Ctx))
|
if (const MDNode *IA = DL.getInlinedAt(Ctx)) {
|
||||||
Scope = ConcreteScopes.lookup(IA);
|
const MDNode *Key = IA;
|
||||||
|
if (const MDNode *Nest = DILocation(IA).getOrigLocation())
|
||||||
|
Key = Nest;
|
||||||
|
Scope = ConcreteScopes.lookup(Key);
|
||||||
|
}
|
||||||
if (Scope == 0)
|
if (Scope == 0)
|
||||||
Scope = DbgScopeMap.lookup(DL.getScope(Ctx));
|
Scope = DbgScopeMap.lookup(DL.getScope(Ctx));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue