diff options
| author | David Blaikie <dblaikie@gmail.com> | 2018-08-16 21:29:55 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2018-08-16 21:29:55 +0000 |
| commit | 66cf14d06b1c5d20417e312fabd14ffaf4314ae3 (patch) | |
| tree | 9c3245caddc10c62c973c81438897198a1477530 /llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | |
| parent | ed89d069f4d6be2913ef5a1ae8fd2f9b28ddaab2 (diff) | |
| download | bcm5719-llvm-66cf14d06b1c5d20417e312fabd14ffaf4314ae3.tar.gz bcm5719-llvm-66cf14d06b1c5d20417e312fabd14ffaf4314ae3.zip | |
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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp index 20b0b8d3fea..119f65e33f5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp @@ -23,6 +23,7 @@ #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Target/TargetLoweringObjectFile.h" #include <algorithm> #include <cstddef> #include <cstdint> @@ -554,12 +555,21 @@ void llvm::emitDWARF5AccelTable( const DwarfDebug &DD, ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs) { std::vector<MCSymbol *> CompUnits; for (const auto &CU : enumerate(CUs)) { + if (CU.value()->getCUNode()->getNameTableKind() == + DICompileUnit::DebugNameTableKind::None) + continue; assert(CU.index() == CU.value()->getUniqueID()); const DwarfCompileUnit *MainCU = DD.useSplitDwarf() ? CU.value()->getSkeleton() : CU.value().get(); CompUnits.push_back(MainCU->getLabelBegin()); } + if (CompUnits.empty()) + return; + + Asm->OutStreamer->SwitchSection( + Asm->getObjFileLowering().getDwarfDebugNamesSection()); + Contents.finalize(Asm, "names"); Dwarf5AccelTableWriter<DWARF5AccelTableData>( Asm, Contents, CompUnits, |

