From 96fb9024f2353f2215549372a30faf445533879c Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 23 May 2014 04:23:06 +0000 Subject: DebugInfo: Fix cross-CU references for scopes (and variables within those scopes) in abstract definitions of cross-CU inlined functions Found by Adrian Prantl during post-commit review of r209335. llvm-svn: 209498 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 049e9e28c11..44aa529cfa4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -528,11 +528,12 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU, // Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram // was inlined from another compile unit. - DIE *ScopeDIE = SPMap[Sub]->getDIE(Sub); + DwarfCompileUnit &SPCU = *SPMap[Sub]; + DIE *ScopeDIE = SPCU.getDIE(Sub); assert(ScopeDIE); AbstractSPDies.insert(std::make_pair(Sub, ScopeDIE)); - TheCU.addUInt(*ScopeDIE, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); - createAndAddScopeChildren(TheCU, Scope, *ScopeDIE); + SPCU.addUInt(*ScopeDIE, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); + createAndAddScopeChildren(SPCU, Scope, *ScopeDIE); } DIE &DwarfDebug::constructSubprogramScopeDIE(DwarfCompileUnit &TheCU, -- cgit v1.2.3