[PATCH] D50213: DebugInfo: Add metadata support for disabling DWARF pub sections

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 19:18:25 PDT 2018


dblaikie created this revision.
dblaikie added reviewers: echristo, aprantl, JDevlieghere, probinson.
Herald added subscribers: dexonsmith, steven_wu, mehdi_amini.

In cases where the debugger load time is a worthwhile tradeoff (or less
costly - such as loading from a DWP instead of a variety of DWOs
(possibly over a high-latency/distributed filesystem)) against object
file size, it can be reasonable to disable pubnames and corresponding
gdb-index creation in the linker.

A backend-flag version of this was implemented for NVPTX in
https://reviews.llvm.org/D44385/r327994 - which was fine for NVPTX which wouldn't mix-and-match
CUs. Now that it's going to be a user-facing option (likely powered by
"-gno-pubnames", the same as GCC) it should be encoded in the
DICompileUnit so it can vary per-CU.

After this, likely the NVPTX support should be migrated to the metadata
& the previous flag implementation should be removed.

(I'm open to ideas on the naming here - whether the field should be called
"pubnames" or "pubnameKind" (to match "emissionKind") & the names of the
parameters (though currently it's a normal enum not an enum class, so the names
are uncscoped within DICompileUnit - so obvious names like "None" cause naming
collissions - hence the slightly awkward "Omitted", which, admittedly, still
isn't great))


Repository:
  rL LLVM

https://reviews.llvm.org/D50213

Files:
  include/llvm/IR/DIBuilder.h
  include/llvm/IR/DebugInfoMetadata.h
  lib/AsmParser/LLLexer.cpp
  lib/AsmParser/LLParser.cpp
  lib/AsmParser/LLToken.h
  lib/Bitcode/Reader/MetadataLoader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/IR/AsmWriter.cpp
  lib/IR/DIBuilder.cpp
  lib/IR/DebugInfo.cpp
  lib/IR/DebugInfoMetadata.cpp
  test/Bitcode/dicompileunit-gnu-pubnames.ll
  test/DebugInfo/X86/gnu-public-names-empty.ll
  test/DebugInfo/X86/gnu-public-names-gmlt.ll
  test/DebugInfo/X86/gnu-public-names-multiple-cus.ll
  test/DebugInfo/X86/gnu-public-names-tu.ll
  test/DebugInfo/X86/gnu-public-names.ll
  test/DebugInfo/X86/no-public-sections-metadata.ll
  test/DebugInfo/X86/no-public-sections.ll
  unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50213.158889.patch
Type: text/x-patch
Size: 28980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180803/b5480fc0/attachment-0001.bin>


More information about the llvm-commits mailing list