Skip to content

Commit

Permalink
[DebugInfo] Emit DW_AT_inline under -g1/-gmlt
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D109554
  • Loading branch information
ZequanWu committed Sep 10, 2021
1 parent 7ba3627 commit 12f80c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
7 changes: 4 additions & 3 deletions llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Expand Up @@ -1105,9 +1105,10 @@ void DwarfCompileUnit::constructAbstractSubprogramScopeDIE(
// shouldn't be found by lookup.
AbsDef = &ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr);
ContextCU->applySubprogramAttributesToDefinition(SP, *AbsDef);

if (!ContextCU->includeMinimalInlineScopes())
ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
ContextCU->addSInt(*AbsDef, dwarf::DW_AT_inline,
DD->getDwarfVersion() <= 4 ? Optional<dwarf::Form>()
: dwarf::DW_FORM_implicit_const,
dwarf::DW_INL_inlined);
if (DIE *ObjectPointer = ContextCU->createAndAddScopeChildren(Scope, *AbsDef))
ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
}
Expand Down
7 changes: 1 addition & 6 deletions llvm/test/DebugInfo/Inputs/gmlt.ll
Expand Up @@ -42,12 +42,7 @@

; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_name {{.*}} "f3"

; FIXME: We don't really need DW_AT_inline, consumers can ignore this due to
; the absence of high_pc/low_pc/ranges and know that they just need it for
; retrieving the name of a concrete inlined instance

; CHECK-NOT: {{DW_TAG|DW_AT|NULL}}
; CHECK-NEXT: DW_AT_inline

; Check that we only provide the minimal attributes on a subprogram to save space.
; CHECK: DW_TAG_subprogram
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/DebugInfo/X86/fission-inline.ll
Expand Up @@ -58,7 +58,7 @@

; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_name {{.*}} "f2<int>"
; CHECK-NOT: DW_
; CHECK-NEXT: DW_AT_inline
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
; CHECK-NEXT: DW_AT_high_pc
Expand Down

0 comments on commit 12f80c0

Please sign in to comment.