[llvm] r209498 - DebugInfo: Fix cross-CU references for scopes (and variables within those scopes) in abstract definitions of cross-CU inlined functions

David Blaikie dblaikie at gmail.com
Thu May 22 21:23:06 PDT 2014


Author: dblaikie
Date: Thu May 22 23:23:06 2014
New Revision: 209498

URL: http://llvm.org/viewvc/llvm-project?rev=209498&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/DebugInfo/cross-cu-inlining.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=209498&r1=209497&r2=209498&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu May 22 23:23:06 2014
@@ -528,11 +528,12 @@ void DwarfDebug::constructAbstractSubpro
 
   // 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,

Modified: llvm/trunk/test/DebugInfo/cross-cu-inlining.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/cross-cu-inlining.ll?rev=209498&r1=209497&r2=209498&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/cross-cu-inlining.ll (original)
+++ llvm/trunk/test/DebugInfo/cross-cu-inlining.ll Thu May 22 23:23:06 2014
@@ -27,6 +27,9 @@
 ; CHECK-NEXT:       DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]])
 ; CHECK:       DW_TAG_formal_parameter
 ; CHECK-NEXT:         DW_AT_abstract_origin {{.*}}[[ABS_VAR:........]])
+; CHECK: 0x[[INT:.*]]: DW_TAG_base_type
+; CHECK-NOT: DW_TAG
+; CHECK:   DW_AT_name {{.*}} "int"
 
 ; Check the abstract definition is in the 'b.cpp' CU and doesn't contain any
 ; concrete information (address range or variable location)
@@ -35,6 +38,9 @@
 ; CHECK: 0x[[ABS_FUNC]]: DW_TAG_subprogram
 ; CHECK-NOT: DW_AT_low_pc
 ; CHECK: 0x[[ABS_VAR]]: DW_TAG_formal_parameter
+; CHECK-NOT: DW_TAG
+; CHECK-NOT: DW_AT_location
+; CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000[[INT]])
 ; CHECK-NOT: DW_AT_location
 
 ; Check the concrete out of line definition references the abstract and





More information about the llvm-commits mailing list