mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-27 14:24:40 +00:00
There are two ways to map a variable to its lexical scope. Lexical scope information is embedded in MDNode describing the variable. It is also available as a part of DebugLoc attached with DBG_VALUE instruction. DebugLoc attached with an instruction is less reliable in optimized code so use information embedded in the MDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135629 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1410,8 +1410,16 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF,
|
||||
if (DV.getTag() == dwarf::DW_TAG_arg_variable &&
|
||||
DISubprogram(DV.getContext()).describes(MF->getFunction()))
|
||||
Scope = CurrentFnDbgScope;
|
||||
else
|
||||
Scope = findDbgScope(MInsn->getDebugLoc());
|
||||
else {
|
||||
if (DV.getVersion() <= LLVMDebugVersion9)
|
||||
Scope = findDbgScope(MInsn->getDebugLoc());
|
||||
else {
|
||||
if (MDNode *IA = DV.getInlinedAt())
|
||||
Scope = InlinedDbgScopeMap.lookup(DebugLoc::getFromDILocation(IA));
|
||||
else
|
||||
Scope = DbgScopeMap.lookup(cast<MDNode>(DV->getOperand(1)));
|
||||
}
|
||||
}
|
||||
// If variable scope is not found then skip this variable.
|
||||
if (!Scope)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user