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());
}
}
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
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;
&Die);
break;
case AccelTableKind::Dwarf:
- AccelDebugNames.addName(InfoHolder.getStringPool().getEntry(*Asm, Name),
- Die);
+ addAccelDebugName(Name, Die);
break;
case AccelTableKind::None:
return;
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;
/// 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();
; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s
; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s
+; Now try the same with split dwarf.
+; RUN: %llc_dwarf -split-dwarf-file=foo.dwo -accel-tables=Dwarf -filetype=obj -o %t < %s
+; RUN: llvm-dwarfdump -debug-names %t | FileCheck %s
+
; Check the header
; CHECK: CU count: 1
; CHECK: Local TU count: 0