mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Use DebugLoc directly to map inlined functions' instructions to respective lexical scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135302 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
72d6f34af1
commit
133b09953c
@ -1593,6 +1593,7 @@ DbgScope *DwarfDebug::getOrCreateDbgScope(DebugLoc DL) {
|
|||||||
|
|
||||||
WScope = new DbgScope(NULL, DIDescriptor(Scope), InlinedAt);
|
WScope = new DbgScope(NULL, DIDescriptor(Scope), InlinedAt);
|
||||||
DbgScopeMap.insert(std::make_pair(InlinedAt, WScope));
|
DbgScopeMap.insert(std::make_pair(InlinedAt, WScope));
|
||||||
|
InlinedDbgScopeMap[DebugLoc::getFromDILocation(InlinedAt)] = WScope;
|
||||||
DbgScope *Parent =
|
DbgScope *Parent =
|
||||||
getOrCreateDbgScope(DebugLoc::getFromDILocation(InlinedAt));
|
getOrCreateDbgScope(DebugLoc::getFromDILocation(InlinedAt));
|
||||||
WScope->setParent(Parent);
|
WScope->setParent(Parent);
|
||||||
@ -2043,6 +2044,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
|||||||
DbgVariableToFrameIndexMap.clear();
|
DbgVariableToFrameIndexMap.clear();
|
||||||
VarToAbstractVarMap.clear();
|
VarToAbstractVarMap.clear();
|
||||||
DbgVariableToDbgInstMap.clear();
|
DbgVariableToDbgInstMap.clear();
|
||||||
|
InlinedDbgScopeMap.clear();
|
||||||
DeleteContainerSeconds(DbgScopeMap);
|
DeleteContainerSeconds(DbgScopeMap);
|
||||||
UserVariables.clear();
|
UserVariables.clear();
|
||||||
DbgValues.clear();
|
DbgValues.clear();
|
||||||
@ -2079,10 +2081,10 @@ DbgScope *DwarfDebug::findDbgScope(DebugLoc DL) {
|
|||||||
|
|
||||||
DbgScope *Scope = NULL;
|
DbgScope *Scope = NULL;
|
||||||
LLVMContext &Ctx = Asm->MF->getFunction()->getContext();
|
LLVMContext &Ctx = Asm->MF->getFunction()->getContext();
|
||||||
const MDNode *N = DL.getScope(Ctx);
|
if (MDNode *IA = DL.getInlinedAt(Ctx))
|
||||||
if (const MDNode *IA = DL.getInlinedAt(Ctx))
|
Scope = InlinedDbgScopeMap.lookup(DebugLoc::getFromDILocation(IA));
|
||||||
N = IA;
|
else
|
||||||
Scope = DbgScopeMap.lookup(N);
|
Scope = DbgScopeMap.lookup(DL.getScope(Ctx));
|
||||||
return Scope;
|
return Scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,9 +201,11 @@ class DwarfDebug {
|
|||||||
|
|
||||||
/// DbgScopeMap - Tracks the scopes in the current function. Owns the
|
/// DbgScopeMap - Tracks the scopes in the current function. Owns the
|
||||||
/// contained DbgScope*s.
|
/// contained DbgScope*s.
|
||||||
///
|
|
||||||
DenseMap<const MDNode *, DbgScope *> DbgScopeMap;
|
DenseMap<const MDNode *, DbgScope *> DbgScopeMap;
|
||||||
|
|
||||||
|
/// InlinedDbgScopeMap - Tracks inlined function scopes in current function.
|
||||||
|
DenseMap<DebugLoc, DbgScope *> InlinedDbgScopeMap;
|
||||||
|
|
||||||
/// AbstractScopes - Tracks the abstract scopes a module. These scopes are
|
/// AbstractScopes - Tracks the abstract scopes a module. These scopes are
|
||||||
/// not included DbgScopeMap. AbstractScopes owns its DbgScope*s.
|
/// not included DbgScopeMap. AbstractScopes owns its DbgScope*s.
|
||||||
DenseMap<const MDNode *, DbgScope *> AbstractScopes;
|
DenseMap<const MDNode *, DbgScope *> AbstractScopes;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user