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
This commit is contained in:
David Blaikie 2019-07-16 21:15:19 +00:00
parent e559f62506
commit 40580d36c4
2 changed files with 7 additions and 2 deletions

View File

@ -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());

View File

@ -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:
@ -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
}
@ -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)