Skip to content

Commit 40580d3

Browse files
committed
DWARF: Skip zero column for inline call sites
D64033 <https://reviews.llvm.org/D64033> added DW_AT_call_column for inline sites. However, that change wasn't aware of "-gno-column-info". To avoid adding column info when "-gno-column-info" is used, now DW_AT_call_column is only added when we have non-zero column (when "-gno-column-info" is used, column will be zero). Patch by Wenlei He! Differential Revision: https://reviews.llvm.org/D64784 llvm-svn: 366264
1 parent e559f62 commit 40580d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ DIE *DwarfCompileUnit::constructInlinedScopeDIE(LexicalScope *Scope) {
543543
addUInt(*ScopeDIE, dwarf::DW_AT_call_file, None,
544544
getOrCreateSourceID(IA->getFile()));
545545
addUInt(*ScopeDIE, dwarf::DW_AT_call_line, None, IA->getLine());
546-
addUInt(*ScopeDIE, dwarf::DW_AT_call_column, None, IA->getColumn());
546+
if (IA->getColumn())
547+
addUInt(*ScopeDIE, dwarf::DW_AT_call_column, None, IA->getColumn());
547548
if (IA->getDiscriminator() && DD->getDwarfVersion() >= 4)
548549
addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, None,
549550
IA->getDiscriminator());

llvm/test/DebugInfo/X86/fission-inline.ll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
; CHECK: DW_AT_call_file
7272
; CHECK-NEXT: DW_AT_call_line {{.*}} (18)
7373
; CHECK-NEXT: DW_AT_call_column {{.*}} (0x05)
74+
; CHECK: DW_AT_call_file
75+
; CHECK-NEXT: DW_AT_call_line {{.*}} (21)
7476
; CHECK-NOT: DW_
7577
; CHECK: .debug_info.dwo contents:
7678

@@ -82,6 +84,7 @@ entry:
8284
call void @_Z2f1v(), !dbg !26
8385
call void @_Z2f1v(), !dbg !25
8486
call void @_Z2f1v(), !dbg !28
87+
call void @_Z2f1v(), !dbg !29
8588
ret void, !dbg !29
8689
}
8790

@@ -122,4 +125,5 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n
122125
!26 = !DILocation(line: 11, column: 3, scope: !11, inlinedAt: !27)
123126
!27 = !DILocation(line: 18, column: 5, scope: !20)
124127
!28 = !DILocation(line: 12, column: 3, scope: !11, inlinedAt: !27)
125-
!29 = !DILocation(line: 21, column: 1, scope: !10)
128+
!29 = !DILocation(line: 12, column: 3, scope: !11, inlinedAt: !30)
129+
!30 = !DILocation(line: 21, column: 0, scope: !10)

0 commit comments

Comments
 (0)