[PATCH] D109554: [DebugInfo] Emit DW_AT_inline under -g1/-gmlt
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 9 18:13:08 PDT 2021
dblaikie added inline comments.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1108-1113
+ if (DD->getDwarfVersion() <= 4)
+ ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, None,
+ dwarf::DW_INL_inlined);
+ else
+ ContextCU->addSInt(*AbsDef, dwarf::DW_AT_inline,
+ dwarf::DW_FORM_implicit_const, dwarf::DW_INL_inlined);
----------------
Could these be collapsed down into:
```
ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, (DD->getDwarfVersion() <= 4 ? std::optional<dwarf::Form>() : dwarf::DW_FORM_implicit_const), dwarf::DW_INL_inlined);
```
? (and/or is there a particular reason one of these is UInt and the other is SInt?
================
Comment at: llvm/test/DebugInfo/Inputs/gmlt.ll:37-41
; FIXME: Emitting separate abstract definitions is inefficient when we could
; just attach the DW_AT_name to the inlined_subroutine directly. Except that
; would produce many string relocations. Implement string indexing in the
; skeleton CU to address the relocation problem, then remove abstract
; definitions from -gmlt here.
----------------
This comment points to an alternate direction at least for DWARFv5 - if that's of interest.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109554/new/
https://reviews.llvm.org/D109554
More information about the llvm-commits
mailing list