DebugInfo: Add metadata support for disabling DWARF pub sections
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 16 Aug 2018 21:29:55 +0000 (21:29 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 16 Aug 2018 21:29:55 +0000 (21:29 +0000)
commit66cf14d06b1c5d20417e312fabd14ffaf4314ae3
tree9c3245caddc10c62c973c81438897198a1477530
parented89d069f4d6be2913ef5a1ae8fd2f9b28ddaab2
DebugInfo: Add metadata support for disabling DWARF pub sections

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
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.

Reviewers: aprantl

Differential Revision: https://reviews.llvm.org/D50213

llvm-svn: 339939
27 files changed:
llvm/include/llvm/IR/DIBuilder.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLToken.h
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/DIBuilder.cpp
llvm/lib/IR/DebugInfo.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/test/Bitcode/dicompileunit-gnu-pubnames.ll
llvm/test/DebugInfo/X86/debug-names-ir-disabled.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/debug-names-partial.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/gnu-public-names-empty.ll
llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll
llvm/test/DebugInfo/X86/gnu-public-names-multiple-cus.ll
llvm/test/DebugInfo/X86/gnu-public-names-tu.ll
llvm/test/DebugInfo/X86/gnu-public-names.ll
llvm/test/DebugInfo/X86/no-public-sections-metadata.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/no-public-sections.ll
llvm/unittests/IR/MetadataTest.cpp