diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-05-11 18:12:17 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-05-11 18:12:17 +0000 |
commit | 9576766be9eda46ffbd890500a378587c096bb68 (patch) | |
tree | 12d8c80425f960bc280df88a823ceb42b94fcc0a /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | a04d5f8d8f2d4be78ae5ca948ba65930b4f73825 (diff) | |
download | bcm5719-llvm-9576766be9eda46ffbd890500a378587c096bb68.tar.gz bcm5719-llvm-9576766be9eda46ffbd890500a378587c096bb68.zip |
DebugInfo: Include lexical scopes in inlined subroutines.
llvm-svn: 208506
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index cad669fbf35..57d46541ddd 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -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; |