Skip to content

Commit

Permalink
DWARF: Skip zero column for inline call sites
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dwblaikie committed Jul 16, 2019
1 parent e559f62 commit 40580d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Expand Up @@ -543,7 +543,8 @@ 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->getColumn())
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());
Expand Down
6 changes: 5 additions & 1 deletion llvm/test/DebugInfo/X86/fission-inline.ll
Expand Up @@ -71,6 +71,8 @@
; CHECK: DW_AT_call_file
; CHECK-NEXT: DW_AT_call_line {{.*}} (18)
; CHECK-NEXT: DW_AT_call_column {{.*}} (0x05)
; CHECK: DW_AT_call_file
; CHECK-NEXT: DW_AT_call_line {{.*}} (21)
; CHECK-NOT: DW_
; CHECK: .debug_info.dwo contents:

Expand All @@ -82,6 +84,7 @@ entry:
call void @_Z2f1v(), !dbg !26
call void @_Z2f1v(), !dbg !25
call void @_Z2f1v(), !dbg !28
call void @_Z2f1v(), !dbg !29
ret void, !dbg !29
}

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

0 comments on commit 40580d3

Please sign in to comment.