[DebugInfo] Add column info for inline sites
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 12 Jul 2019 19:25:45 +0000 (19:25 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 12 Jul 2019 19:25:45 +0000 (19:25 +0000)
The column field is missing for all inline sites, currently it's always
zero. This changes populates DW_AT_call_column field for inline sites.
Test case modified to cover this change.

Patch by: Wenlei He

Differential revision: https://reviews.llvm.org/D64033

llvm-svn: 365945

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/test/DebugInfo/Inputs/gmlt.ll
llvm/test/DebugInfo/NVPTX/debug-info.ll
llvm/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
llvm/test/DebugInfo/X86/fission-inline.ll

index 4163fdb..8862fa1 100644 (file)
@@ -543,6 +543,7 @@ DIE *DwarfCompileUnit::constructInlinedScopeDIE(LexicalScope *Scope) {
   addUInt(*ScopeDIE, dwarf::DW_AT_call_file, None,
           getOrCreateSourceID(IA->getFile()));
   addUInt(*ScopeDIE, dwarf::DW_AT_call_line, None, IA->getLine());
+  addUInt(*ScopeDIE, dwarf::DW_AT_call_column, None, IA->getColumn());
   if (IA->getDiscriminator() && DD->getDwarfVersion() >= 4)
     addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, None,
             IA->getDiscriminator());
index b6050e2..a43395b 100644 (file)
@@ -67,6 +67,7 @@
 ; CHECK-NEXT:       DW_AT_high_pc
 ; CHECK-NEXT:       DW_AT_call_file
 ; CHECK-NEXT:       DW_AT_call_line
+; CHECK-NEXT:       DW_AT_call_column
 
 ; Make sure we don't have any other subprograms here (subprograms with no
 ; inlined subroutines are omitted by design to save space)
index e3fbaf9..7164bc8 100644 (file)
@@ -670,6 +670,8 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK-NEXT: .b8 11                               // DW_FORM_data1
 ; CHECK-NEXT: .b8 89                               // DW_AT_call_line
 ; CHECK-NEXT: .b8 11                               // DW_FORM_data1
+; CHECK-NEXT: .b8 87                               // DW_AT_call_column
+; CHECK-NEXT: .b8 11                               // DW_FORM_data1
 ; CHECK-NEXT: .b8 0                                // EOM(1)
 ; CHECK-NEXT: .b8 0                                // EOM(2)
 ; CHECK-NEXT: .b8 43                               // Abbreviation Code
@@ -685,6 +687,8 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK-NEXT: .b8 11                               // DW_FORM_data1
 ; CHECK-NEXT: .b8 89                               // DW_AT_call_line
 ; CHECK-NEXT: .b8 11                               // DW_FORM_data1
+; CHECK-NEXT: .b8 87                               // DW_AT_call_column
+; CHECK-NEXT: .b8 11                               // DW_FORM_data1
 ; CHECK-NEXT: .b8 0                                // EOM(1)
 ; CHECK-NEXT: .b8 0                                // EOM(2)
 ; CHECK-NEXT: .b8 44                               // Abbreviation Code
@@ -698,12 +702,12 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK-NEXT: }
 ; CHECK-NEXT: .section .debug_info
 ; CHECK-NEXT: {
-; CHECK-NEXT: .b32 10030                           // Length of Unit
+; CHECK-NEXT: .b32 10034                           // Length of Unit
 ; CHECK-NEXT: .b8 2                                // DWARF version number
 ; CHECK-NEXT: .b8 0
 ; CHECK-NEXT: .b32 .debug_abbrev                   // Offset Into Abbrev. Section
 ; CHECK-NEXT: .b8 8                                // Address Size (in bytes)
-; CHECK-NEXT: .b8 1                                // Abbrev [1] 0xb:0x2727 DW_TAG_compile_unit
+; CHECK-NEXT: .b8 1                                // Abbrev [1] 0xb:0x272b DW_TAG_compile_unit
 ; CHECK-NEXT: .b8 0                                // DW_AT_producer
 ; CHECK-NEXT: .b8 4                                // DW_AT_language
 ; CHECK-NEXT: .b8 0
@@ -8302,7 +8306,7 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK-NEXT: .b8 3                                // DW_AT_decl_line
 ; CHECK-NEXT: .b32 3345                            // DW_AT_type
 ; CHECK-NEXT: .b8 0                                // End Of Children Mark
-; CHECK-NEXT: .b8 40                               // Abbrev [40] 0x2671:0xc0 DW_TAG_subprogram
+; CHECK-NEXT: .b8 40                               // Abbrev [40] 0x2671:0xc4 DW_TAG_subprogram
 ; CHECK-NEXT: .b64 Lfunc_begin0                    // DW_AT_low_pc
 ; CHECK-NEXT: .b64 Lfunc_end0                      // DW_AT_high_pc
 ; CHECK-NEXT: .b8 1                                // DW_AT_frame_base
@@ -8361,33 +8365,37 @@ if.end:                                           ; preds = %if.then, %entry
 ; CHECK-NEXT: .b8 12                               // DW_AT_decl_file
 ; CHECK-NEXT: .b8 6                                // DW_AT_decl_line
 ; CHECK-NEXT: .b32 2332                            // DW_AT_type
-; CHECK-NEXT: .b8 42                               // Abbrev [42] 0x26c9:0x17 DW_TAG_inlined_subroutine
+; CHECK-NEXT: .b8 42                               // Abbrev [42] 0x26c9:0x18 DW_TAG_inlined_subroutine
 ; CHECK-NEXT: .b32 8432                            // DW_AT_abstract_origin
 ; CHECK-NEXT: .b64 Ltmp0                           // DW_AT_low_pc
 ; CHECK-NEXT: .b64 Ltmp1                           // DW_AT_high_pc
 ; CHECK-NEXT: .b8 12                               // DW_AT_call_file
 ; CHECK-NEXT: .b8 6                                // DW_AT_call_line
-; CHECK-NEXT: .b8 42                               // Abbrev [42] 0x26e0:0x17 DW_TAG_inlined_subroutine
+; CHECK-NEXT: .b8 11                               // DW_AT_call_column
+; CHECK-NEXT: .b8 42                               // Abbrev [42] 0x26e1:0x18 DW_TAG_inlined_subroutine
 ; CHECK-NEXT: .b32 9191                            // DW_AT_abstract_origin
 ; CHECK-NEXT: .b64 Ltmp1                           // DW_AT_low_pc
 ; CHECK-NEXT: .b64 Ltmp2                           // DW_AT_high_pc
 ; CHECK-NEXT: .b8 12                               // DW_AT_call_file
 ; CHECK-NEXT: .b8 6                                // DW_AT_call_line
-; CHECK-NEXT: .b8 42                               // Abbrev [42] 0x26f7:0x17 DW_TAG_inlined_subroutine
+; CHECK-NEXT: .b8 24                               // DW_AT_call_column
+; CHECK-NEXT: .b8 42                               // Abbrev [42] 0x26f9:0x18 DW_TAG_inlined_subroutine
 ; CHECK-NEXT: .b32 9785                            // DW_AT_abstract_origin
 ; CHECK-NEXT: .b64 Ltmp2                           // DW_AT_low_pc
 ; CHECK-NEXT: .b64 Ltmp3                           // DW_AT_high_pc
 ; CHECK-NEXT: .b8 12                               // DW_AT_call_file
 ; CHECK-NEXT: .b8 6                                // DW_AT_call_line
-; CHECK-NEXT: .b8 43                               // Abbrev [43] 0x270e:0x22 DW_TAG_inlined_subroutine
+; CHECK-NEXT: .b8 37                               // DW_AT_call_column
+; CHECK-NEXT: .b8 43                               // Abbrev [43] 0x2711:0x23 DW_TAG_inlined_subroutine
 ; CHECK-NEXT: .b32 9791                            // DW_AT_abstract_origin
 ; CHECK-NEXT: .b64 Ltmp10                          // DW_AT_low_pc
 ; CHECK-NEXT: .b64 Ltmp11                          // DW_AT_high_pc
 ; CHECK-NEXT: .b8 12                               // DW_AT_call_file
 ; CHECK-NEXT: .b8 8                                // DW_AT_call_line
-; CHECK-NEXT: .b8 44                               // Abbrev [44] 0x2725:0x5 DW_TAG_formal_parameter
+; CHECK-NEXT: .b8 5                                // DW_AT_call_column
+; CHECK-NEXT: .b8 44                               // Abbrev [44] 0x2729:0x5 DW_TAG_formal_parameter
 ; CHECK-NEXT: .b32 9811                            // DW_AT_abstract_origin
-; CHECK-NEXT: .b8 44                               // Abbrev [44] 0x272a:0x5 DW_TAG_formal_parameter
+; CHECK-NEXT: .b8 44                               // Abbrev [44] 0x272e:0x5 DW_TAG_formal_parameter
 ; CHECK-NEXT: .b32 9820                            // DW_AT_abstract_origin
 ; CHECK-NEXT: .b8 0                                // End Of Children Mark
 ; CHECK-NEXT: .b8 0                                // End Of Children Mark
index 5caa80c..8fa769c 100644 (file)
@@ -30,6 +30,7 @@
 ;CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
 ;CHECK-NEXT: DW_AT_call_file
 ;CHECK-NEXT: DW_AT_call_line
+;CHECK-NEXT: DW_AT_call_column
 
 ;CHECK: DW_TAG_formal_parameter
 ;CHECK-NOT: DW_TAG
index 64bd13b..0702465 100644 (file)
@@ -70,6 +70,7 @@
 ; CHECK-NOT: {{DW_AT|DW_TAG|NULL}}
 ; CHECK:     DW_AT_call_file
 ; CHECK-NEXT:     DW_AT_call_line {{.*}} (18)
+; CHECK-NEXT:     DW_AT_call_column {{.*}} (0x05)
 ; CHECK-NOT: DW_
 ; CHECK: .debug_info.dwo contents: