mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
DebugInfo: Include lexical scopes in inlined subroutines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -621,7 +621,7 @@ std::unique_ptr<DIE> DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU,
|
||||
// avoid creating un-used children then removing them later when we find out
|
||||
// the scope DIE is null.
|
||||
std::unique_ptr<DIE> ScopeDIE;
|
||||
if (Scope->getInlinedAt()) {
|
||||
if (DS.getContext() && DS.isSubprogram()) {
|
||||
ScopeDIE = constructInlinedScopeDIE(TheCU, Scope);
|
||||
if (!ScopeDIE)
|
||||
return nullptr;
|
||||
@ -1212,10 +1212,12 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
|
||||
if (DV.getTag() == dwarf::DW_TAG_arg_variable &&
|
||||
DISubprogram(DV.getContext()).describes(CurFn->getFunction()))
|
||||
Scope = LScopes.getCurrentFunctionScope();
|
||||
else if (MDNode *IA = DV.getInlinedAt())
|
||||
Scope = LScopes.findInlinedScope(DebugLoc::getFromDILocation(IA));
|
||||
else
|
||||
Scope = LScopes.findLexicalScope(cast<MDNode>(DV->getOperand(1)));
|
||||
else if (MDNode *IA = DV.getInlinedAt()) {
|
||||
DebugLoc DL = DebugLoc::getFromDILocation(IA);
|
||||
Scope = LScopes.findInlinedScope(DebugLoc::get(
|
||||
DL.getLine(), DL.getCol(), DV.getContext(), IA));
|
||||
} else
|
||||
Scope = LScopes.findLexicalScope(DV.getContext());
|
||||
// If variable scope is not found then skip this variable.
|
||||
if (!Scope)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user