mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
If there is not any llvm instruction associated with each lexical scope encoded in debug info then create such scope on demand for variable info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84262 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1811,10 +1811,18 @@ void DwarfDebug::CollectVariableInfo() {
|
||||
DIVariable DV (Var);
|
||||
if (DV.isNull()) continue;
|
||||
unsigned VSlot = VI->second;
|
||||
DbgScope *Scope = NULL;
|
||||
DenseMap<MDNode *, DbgScope *>::iterator DSI =
|
||||
DbgScopeMap.find(DV.getContext().getNode());
|
||||
assert (DSI != DbgScopeMap.end() && "Unable to find variable scope!");
|
||||
DbgScope *Scope = DSI->second;
|
||||
if (DSI != DbgScopeMap.end())
|
||||
Scope = DSI->second;
|
||||
else
|
||||
// There is not any instruction assocated with this scope, so get
|
||||
// a new scope.
|
||||
Scope = getDbgScope(DV.getContext().getNode(),
|
||||
NULL /* Not an instruction */,
|
||||
NULL /* Not inlined */);
|
||||
assert (Scope && "Unable to find variable scope!");
|
||||
Scope->AddVariable(new DbgVariable(DV, VSlot, false));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user