summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp16
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h4
3 files changed, 17 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp b/llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp
index 1107e020696..a1ae137d266 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());
}
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 177a094b68b..a8e36ec66e5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2267,6 +2267,13 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
CU.addDIETypeSignature(RefDie, Signature);
}
+void DwarfDebug::addAccelDebugName(StringRef Name, const DIE &Die) {
+ assert(getAccelTableKind() == AccelTableKind::Dwarf);
+
+ DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
+ AccelDebugNames.addName(Holder.getStringPool().getEntry(*Asm, Name), Die);
+}
+
// Accelerator table mutators - add each name along with its companion
// DIE to the proper table while ensuring that the name that we're going
// to reference is in the string table. We do this since the names we
@@ -2277,8 +2284,7 @@ void DwarfDebug::addAccelName(StringRef Name, const DIE &Die) {
AccelNames.addName(InfoHolder.getStringPool().getEntry(*Asm, Name), &Die);
break;
case AccelTableKind::Dwarf:
- AccelDebugNames.addName(InfoHolder.getStringPool().getEntry(*Asm, Name),
- Die);
+ addAccelDebugName(Name, Die);
break;
case AccelTableKind::None:
return;
@@ -2300,8 +2306,7 @@ void DwarfDebug::addAccelNamespace(StringRef Name, const DIE &Die) {
&Die);
break;
case AccelTableKind::Dwarf:
- AccelDebugNames.addName(InfoHolder.getStringPool().getEntry(*Asm, Name),
- Die);
+ addAccelDebugName(Name, Die);
break;
case AccelTableKind::None:
return;
@@ -2316,8 +2321,7 @@ void DwarfDebug::addAccelType(StringRef Name, const DIE &Die, char Flags) {
AccelTypes.addName(InfoHolder.getStringPool().getEntry(*Asm, Name), &Die);
break;
case AccelTableKind::Dwarf:
- AccelDebugNames.addName(InfoHolder.getStringPool().getEntry(*Asm, Name),
- Die);
+ addAccelDebugName(Name, Die);
break;
case AccelTableKind::None:
return;
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index bd248fd1951..f01d68028eb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -339,6 +339,10 @@ class DwarfDebug : public DebugHandlerBase {
/// Construct a DIE for this abstract scope.
void constructAbstractSubprogramScopeDIE(DwarfCompileUnit &SrcCU, LexicalScope *Scope);
+ /// Helper function to add a name to the .debug_names table, using the
+ /// appropriate string pool.
+ void addAccelDebugName(StringRef Name, const DIE &Die);
+
void finishVariableDefinitions();
void finishSubprogramDefinitions();
OpenPOWER on IntegriCloud