aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-04-18 12:11:59 +0000
committerPavel Labath <labath@google.com>2018-04-18 12:11:59 +0000
commit3fb39c79ed7f9f50e3d853ac64c7bb982fcd9d68 (patch)
treec55cfe629b931876705163a9c51f1f513856619b /llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
parent1243ebdcdb6e103a5789912d0582b17f2056d370 (diff)
downloadllvm-3fb39c79ed7f9f50e3d853ac64c7bb982fcd9d68.zip
llvm-3fb39c79ed7f9f50e3d853ac64c7bb982fcd9d68.tar.gz
llvm-3fb39c79ed7f9f50e3d853ac64c7bb982fcd9d68.tar.bz2
[CodeGen/Dwarf] Make debug_names compatible with split-dwarf
Summary: Previously we crashed for the combination of the two features because we tried to reference the dwo CU from the main object file. The fix consists of two items: - reference the skeleton CU from the name index (the consumer is expected to use the skeleton CU to find the real data). - use the main object file string pool for the strings in the index Reviewers: JDevlieghere, aprantl, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45566 llvm-svn: 330249
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
index 1107e02..a1ae137 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
@@ -416,7 +416,9 @@ void Dwarf5AccelTableEmitter::emitCUList() const {
for (const auto &CU : enumerate(CompUnits)) {
assert(CU.index() == CU.value()->getUniqueID());
Asm->OutStreamer->AddComment("Compilation unit " + Twine(CU.index()));
- Asm->emitDwarfSymbolReference(CU.value()->getLabelBegin());
+ const DwarfCompileUnit *MainCU =
+ DD.useSplitDwarf() ? CU.value()->getSkeleton() : CU.value().get();
+ Asm->emitDwarfSymbolReference(MainCU->getLabelBegin());
}
}