This prompted me to push references through most of DwarfDebug. Sorry
for the churn.
Honestly it's a bit silly that we're passing around units all over the
place like that anyway and I think it's mostly due to the DIE attribute
adding utility functions being utilities in DwarfUnit. I should have
another go at moving them out of DwarfUnit...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206925
91177308-0d34-0410-b5e6-
96231b3b80d8
-void DwarfFile::addUnit(DwarfUnit *CU) {
- CUs.push_back(std::unique_ptr<DwarfUnit>(CU));
+void DwarfFile::addUnit(std::unique_ptr<DwarfUnit> U) {
+ CUs.push_back(std::move(U));
}
static bool isObjCClass(StringRef Name) {
}
static bool isObjCClass(StringRef Name) {
// TODO: Determine whether or not we should add names for programs
// that do not have a DW_AT_name or DW_AT_linkage_name field - this
// is only slightly different than the lookup of non-standard ObjC names.
// TODO: Determine whether or not we should add names for programs
// that do not have a DW_AT_name or DW_AT_linkage_name field - this
// is only slightly different than the lookup of non-standard ObjC names.
-static void addSubprogramNames(DwarfUnit *TheU, DISubprogram SP, DIE *Die) {
+static void addSubprogramNames(DwarfUnit &TheU, DISubprogram SP, DIE *Die) {
if (!SP.isDefinition())
return;
if (!SP.isDefinition())
return;
- TheU->addAccelName(SP.getName(), Die);
+ TheU.addAccelName(SP.getName(), Die);
// If the linkage name is different than the name, go ahead and output
// that as well into the name table.
if (SP.getLinkageName() != "" && SP.getName() != SP.getLinkageName())
// If the linkage name is different than the name, go ahead and output
// that as well into the name table.
if (SP.getLinkageName() != "" && SP.getName() != SP.getLinkageName())
- TheU->addAccelName(SP.getLinkageName(), Die);
+ TheU.addAccelName(SP.getLinkageName(), Die);
// If this is an Objective-C selector name add it to the ObjC accelerator
// too.
if (isObjCClass(SP.getName())) {
StringRef Class, Category;
getObjCClassCategory(SP.getName(), Class, Category);
// If this is an Objective-C selector name add it to the ObjC accelerator
// too.
if (isObjCClass(SP.getName())) {
StringRef Class, Category;
getObjCClassCategory(SP.getName(), Class, Category);
- TheU->addAccelObjC(Class, Die);
+ TheU.addAccelObjC(Class, Die);
- TheU->addAccelObjC(Category, Die);
+ TheU.addAccelObjC(Category, Die);
// Also add the base method name to the name table.
// Also add the base method name to the name table.
- TheU->addAccelName(getObjCMethodName(SP.getName()), Die);
+ TheU.addAccelName(getObjCMethodName(SP.getName()), Die);
// Find DIE for the given subprogram and attach appropriate DW_AT_low_pc
// and DW_AT_high_pc attributes. If there are global variables in this
// scope then create and insert DIEs for these variables.
// Find DIE for the given subprogram and attach appropriate DW_AT_low_pc
// and DW_AT_high_pc attributes. If there are global variables in this
// scope then create and insert DIEs for these variables.
-DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
+DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
- DIE *SPDie = SPCU->getDIE(SP);
+ DIE *SPDie = SPCU.getDIE(SP);
assert(SPDie && "Unable to find subprogram DIE!");
assert(SPDie && "Unable to find subprogram DIE!");
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) {
// Pick up abstract subprogram DIE.
SPDie =
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) {
// Pick up abstract subprogram DIE.
SPDie =
- SPCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *SPCU->getUnitDie());
- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
+ SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, *SPCU.getUnitDie());
+ SPCU.addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
} else {
DISubprogram SPDecl = SP.getFunctionDeclaration();
if (!SPDecl.isSubprogram()) {
} else {
DISubprogram SPDecl = SP.getFunctionDeclaration();
if (!SPDecl.isSubprogram()) {
DIScope SPContext = resolve(SP.getContext());
if (SP.isDefinition() && !SPContext.isCompileUnit() &&
!SPContext.isFile() && !isSubprogramContext(SPContext)) {
DIScope SPContext = resolve(SP.getContext());
if (SP.isDefinition() && !SPContext.isCompileUnit() &&
!SPContext.isFile() && !isSubprogramContext(SPContext)) {
- SPCU->addFlag(SPDie, dwarf::DW_AT_declaration);
+ SPCU.addFlag(SPDie, dwarf::DW_AT_declaration);
// Add arguments.
DICompositeType SPTy = SP.getType();
DIArray Args = SPTy.getTypeArray();
uint16_t SPTag = SPTy.getTag();
if (SPTag == dwarf::DW_TAG_subroutine_type)
// Add arguments.
DICompositeType SPTy = SP.getType();
DIArray Args = SPTy.getTypeArray();
uint16_t SPTag = SPTy.getTag();
if (SPTag == dwarf::DW_TAG_subroutine_type)
- SPCU->constructSubprogramArguments(*SPDie, Args);
+ SPCU.constructSubprogramArguments(*SPDie, Args);
- SPDie = SPCU->createAndAddDIE(dwarf::DW_TAG_subprogram,
- *SPCU->getUnitDie());
- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_specification, SPDeclDie);
+ SPDie = SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram,
+ *SPCU.getUnitDie());
+ SPCU.addDIEEntry(SPDie, dwarf::DW_AT_specification, SPDeclDie);
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
MachineLocation Location(RI->getFrameRegister(*Asm->MF));
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
MachineLocation Location(RI->getFrameRegister(*Asm->MF));
- SPCU->addAddress(SPDie, dwarf::DW_AT_frame_base, Location);
+ SPCU.addAddress(SPDie, dwarf::DW_AT_frame_base, Location);
// Add name to the name table, we do this here because we're guaranteed
// to have concrete versions of our DW_TAG_subprogram nodes.
// Add name to the name table, we do this here because we're guaranteed
// to have concrete versions of our DW_TAG_subprogram nodes.
-static void addSectionLabel(AsmPrinter *Asm, DwarfUnit *U, DIE *D,
+static void addSectionLabel(AsmPrinter &Asm, DwarfUnit &U, DIE *D,
dwarf::Attribute A, const MCSymbol *L,
const MCSymbol *Sec) {
dwarf::Attribute A, const MCSymbol *L,
const MCSymbol *Sec) {
- if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
- U->addSectionLabel(D, A, L);
+ if (Asm.MAI->doesDwarfUseRelocationsAcrossSections())
+ U.addSectionLabel(D, A, L);
- U->addSectionDelta(D, A, L, Sec);
+ U.addSectionDelta(D, A, L, Sec);
-void DwarfDebug::addScopeRangeList(DwarfCompileUnit *TheCU, DIE *ScopeDIE,
+void DwarfDebug::addScopeRangeList(DwarfCompileUnit &TheCU, DIE *ScopeDIE,
const SmallVectorImpl<InsnRange> &Range) {
// Emit offset in .debug_range as a relocatable label. emitDIE will handle
// emitting it appropriately.
const SmallVectorImpl<InsnRange> &Range) {
// Emit offset in .debug_range as a relocatable label. emitDIE will handle
// emitting it appropriately.
// Under fission, ranges are specified by constant offsets relative to the
// CU's DW_AT_GNU_ranges_base.
if (useSplitDwarf())
// Under fission, ranges are specified by constant offsets relative to the
// CU's DW_AT_GNU_ranges_base.
if (useSplitDwarf())
- TheCU->addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, RangeSym,
+ TheCU.addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, RangeSym,
DwarfDebugRangeSectionSym);
else
DwarfDebugRangeSectionSym);
else
- addSectionLabel(Asm, TheCU, ScopeDIE, dwarf::DW_AT_ranges, RangeSym,
+ addSectionLabel(*Asm, TheCU, ScopeDIE, dwarf::DW_AT_ranges, RangeSym,
DwarfDebugRangeSectionSym);
RangeSpanList List(RangeSym);
DwarfDebugRangeSectionSym);
RangeSpanList List(RangeSym);
}
// Add the range list to the set of ranges to be emitted.
}
// Add the range list to the set of ranges to be emitted.
- TheCU->addRangeList(std::move(List));
+ TheCU.addRangeList(std::move(List));
}
// Construct new DW_TAG_lexical_block for this scope and attach
// DW_AT_low_pc/DW_AT_high_pc labels.
}
// Construct new DW_TAG_lexical_block for this scope and attach
// DW_AT_low_pc/DW_AT_high_pc labels.
-DIE *DwarfDebug::constructLexicalScopeDIE(DwarfCompileUnit *TheCU,
+DIE *DwarfDebug::constructLexicalScopeDIE(DwarfCompileUnit &TheCU,
LexicalScope *Scope) {
if (isLexicalScopeDIENull(Scope))
return 0;
LexicalScope *Scope) {
if (isLexicalScopeDIENull(Scope))
return 0;
// This scope represents inlined body of a function. Construct DIE to
// represent this concrete inlined copy of the function.
// This scope represents inlined body of a function. Construct DIE to
// represent this concrete inlined copy of the function.
-DIE *DwarfDebug::constructInlinedScopeDIE(DwarfCompileUnit *TheCU,
+DIE *DwarfDebug::constructInlinedScopeDIE(DwarfCompileUnit &TheCU,
LexicalScope *Scope) {
const SmallVectorImpl<InsnRange> &ScopeRanges = Scope->getRanges();
assert(!ScopeRanges.empty() &&
LexicalScope *Scope) {
const SmallVectorImpl<InsnRange> &ScopeRanges = Scope->getRanges();
assert(!ScopeRanges.empty() &&
return NULL;
DIScope DS(Scope->getScopeNode());
DISubprogram InlinedSP = getDISubprogram(DS);
return NULL;
DIScope DS(Scope->getScopeNode());
DISubprogram InlinedSP = getDISubprogram(DS);
- DIE *OriginDIE = TheCU->getDIE(InlinedSP);
+ DIE *OriginDIE = TheCU.getDIE(InlinedSP);
if (!OriginDIE) {
DEBUG(dbgs() << "Unable to find original DIE for an inlined subprogram.");
return NULL;
}
DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
if (!OriginDIE) {
DEBUG(dbgs() << "Unable to find original DIE for an inlined subprogram.");
return NULL;
}
DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
- TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin, OriginDIE);
+ TheCU.addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin, OriginDIE);
// If we have multiple ranges, emit them into the range section.
if (ScopeRanges.size() > 1)
// If we have multiple ranges, emit them into the range section.
if (ScopeRanges.size() > 1)
// Add the call site information to the DIE.
DILocation DL(Scope->getInlinedAt());
// Add the call site information to the DIE.
DILocation DL(Scope->getInlinedAt());
ScopeDIE, dwarf::DW_AT_call_file, None,
ScopeDIE, dwarf::DW_AT_call_file, None,
- TheCU->getOrCreateSourceID(DL.getFilename(), DL.getDirectory()));
- TheCU->addUInt(ScopeDIE, dwarf::DW_AT_call_line, None, DL.getLineNumber());
+ TheCU.getOrCreateSourceID(DL.getFilename(), DL.getDirectory()));
+ TheCU.addUInt(ScopeDIE, dwarf::DW_AT_call_line, None, DL.getLineNumber());
// Add name to the name table, we do this here because we're guaranteed
// to have concrete versions of our DW_TAG_inlined_subprogram nodes.
// Add name to the name table, we do this here because we're guaranteed
// to have concrete versions of our DW_TAG_inlined_subprogram nodes.
-DIE *DwarfDebug::createScopeChildrenDIE(DwarfCompileUnit *TheCU,
+DIE *DwarfDebug::createScopeChildrenDIE(DwarfCompileUnit &TheCU,
LexicalScope *Scope,
SmallVectorImpl<DIE *> &Children) {
DIE *ObjectPointer = NULL;
LexicalScope *Scope,
SmallVectorImpl<DIE *> &Children) {
DIE *ObjectPointer = NULL;
for (DbgVariable *ArgDV : CurrentFnArguments)
if (ArgDV)
if (DIE *Arg =
for (DbgVariable *ArgDV : CurrentFnArguments)
if (ArgDV)
if (DIE *Arg =
- TheCU->constructVariableDIE(*ArgDV, Scope->isAbstractScope())) {
+ TheCU.constructVariableDIE(*ArgDV, Scope->isAbstractScope())) {
Children.push_back(Arg);
if (ArgDV->isObjectPointer())
ObjectPointer = Arg;
Children.push_back(Arg);
if (ArgDV->isObjectPointer())
ObjectPointer = Arg;
// Collect lexical scope children first.
for (DbgVariable *DV : ScopeVariables.lookup(Scope))
// Collect lexical scope children first.
for (DbgVariable *DV : ScopeVariables.lookup(Scope))
- if (DIE *Variable = TheCU->constructVariableDIE(*DV,
+ if (DIE *Variable = TheCU.constructVariableDIE(*DV,
Scope->isAbstractScope())) {
Children.push_back(Variable);
if (DV->isObjectPointer())
Scope->isAbstractScope())) {
Children.push_back(Variable);
if (DV->isObjectPointer())
}
// Construct a DIE for this scope.
}
// Construct a DIE for this scope.
-DIE *DwarfDebug::constructScopeDIE(DwarfCompileUnit *TheCU,
+DIE *DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU,
LexicalScope *Scope) {
if (!Scope || !Scope->getScopeNode())
return NULL;
LexicalScope *Scope) {
if (!Scope || !Scope->getScopeNode())
return NULL;
else if (DS.isSubprogram()) {
ProcessedSPNodes.insert(DS);
if (Scope->isAbstractScope()) {
else if (DS.isSubprogram()) {
ProcessedSPNodes.insert(DS);
if (Scope->isAbstractScope()) {
- ScopeDIE = TheCU->getDIE(DS);
+ ScopeDIE = TheCU.getDIE(DS);
// Note down abstract DIE.
if (ScopeDIE)
AbstractSPDies.insert(std::make_pair(DS, ScopeDIE));
// Note down abstract DIE.
if (ScopeDIE)
AbstractSPDies.insert(std::make_pair(DS, ScopeDIE));
ScopeDIE->addChild(I);
if (DS.isSubprogram() && ObjectPointer != NULL)
ScopeDIE->addChild(I);
if (DS.isSubprogram() && ObjectPointer != NULL)
- TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, ObjectPointer);
+ TheCU.addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, ObjectPointer);
-void DwarfDebug::addGnuPubAttributes(DwarfUnit *U, DIE *D) const {
+void DwarfDebug::addGnuPubAttributes(DwarfUnit &U, DIE *D) const {
if (!GenerateGnuPubSections)
return;
if (!GenerateGnuPubSections)
return;
- U->addFlag(D, dwarf::DW_AT_GNU_pubnames);
+ U.addFlag(D, dwarf::DW_AT_GNU_pubnames);
}
// Create new DwarfCompileUnit for the given metadata node with tag
// DW_TAG_compile_unit.
}
// Create new DwarfCompileUnit for the given metadata node with tag
// DW_TAG_compile_unit.
-DwarfCompileUnit *DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
+DwarfCompileUnit &DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
StringRef FN = DIUnit.getFilename();
CompilationDir = DIUnit.getDirectory();
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
StringRef FN = DIUnit.getFilename();
CompilationDir = DIUnit.getDirectory();
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
- DwarfCompileUnit *NewCU = new DwarfCompileUnit(
+ auto OwnedUnit = make_unique<DwarfCompileUnit>(
InfoHolder.getUnits().size(), Die, DIUnit, Asm, this, &InfoHolder);
InfoHolder.getUnits().size(), Die, DIUnit, Asm, this, &InfoHolder);
- InfoHolder.addUnit(NewCU);
+ DwarfCompileUnit &NewCU = *OwnedUnit;
+ InfoHolder.addUnit(std::move(OwnedUnit));
+
// LTO with assembly output shares a single line table amongst multiple CUs.
// To avoid the compilation directory being ambiguous, let the line table
// LTO with assembly output shares a single line table amongst multiple CUs.
// To avoid the compilation directory being ambiguous, let the line table
// compilation directory.
if (!Asm->OutStreamer.hasRawTextSupport() || SingleCU)
Asm->OutStreamer.getContext().setMCLineTableCompilationDir(
// compilation directory.
if (!Asm->OutStreamer.hasRawTextSupport() || SingleCU)
Asm->OutStreamer.getContext().setMCLineTableCompilationDir(
- NewCU->getUniqueID(), CompilationDir);
+ NewCU.getUniqueID(), CompilationDir);
- NewCU->addString(Die, dwarf::DW_AT_producer, DIUnit.getProducer());
- NewCU->addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
+ NewCU.addString(Die, dwarf::DW_AT_producer, DIUnit.getProducer());
+ NewCU.addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
- NewCU->addString(Die, dwarf::DW_AT_name, FN);
+ NewCU.addString(Die, dwarf::DW_AT_name, FN);
- NewCU->initStmtList(DwarfLineSectionSym);
+ NewCU.initStmtList(DwarfLineSectionSym);
// If we're using split dwarf the compilation dir is going to be in the
// skeleton CU and so we don't need to duplicate it here.
if (!CompilationDir.empty())
// If we're using split dwarf the compilation dir is going to be in the
// skeleton CU and so we don't need to duplicate it here.
if (!CompilationDir.empty())
- NewCU->addString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
+ NewCU.addString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
addGnuPubAttributes(NewCU, Die);
}
if (DIUnit.isOptimized())
addGnuPubAttributes(NewCU, Die);
}
if (DIUnit.isOptimized())
- NewCU->addFlag(Die, dwarf::DW_AT_APPLE_optimized);
+ NewCU.addFlag(Die, dwarf::DW_AT_APPLE_optimized);
StringRef Flags = DIUnit.getFlags();
if (!Flags.empty())
StringRef Flags = DIUnit.getFlags();
if (!Flags.empty())
- NewCU->addString(Die, dwarf::DW_AT_APPLE_flags, Flags);
+ NewCU.addString(Die, dwarf::DW_AT_APPLE_flags, Flags);
if (unsigned RVer = DIUnit.getRunTimeVersion())
if (unsigned RVer = DIUnit.getRunTimeVersion())
- NewCU->addUInt(Die, dwarf::DW_AT_APPLE_major_runtime_vers,
+ NewCU.addUInt(Die, dwarf::DW_AT_APPLE_major_runtime_vers,
dwarf::DW_FORM_data1, RVer);
if (!FirstCU)
dwarf::DW_FORM_data1, RVer);
if (!FirstCU)
- NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoDWOSection(),
+ NewCU.initSection(Asm->getObjFileLowering().getDwarfInfoDWOSection(),
- NewCU->setSkeleton(constructSkeletonCU(NewCU));
+ NewCU.setSkeleton(constructSkeletonCU(NewCU));
- NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
+ NewCU.initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
- CUMap.insert(std::make_pair(DIUnit, NewCU));
- CUDieMap.insert(std::make_pair(Die, NewCU));
+ CUMap.insert(std::make_pair(DIUnit, &NewCU));
+ CUDieMap.insert(std::make_pair(Die, &NewCU));
return NewCU;
}
// Construct subprogram DIE.
return NewCU;
}
// Construct subprogram DIE.
-void DwarfDebug::constructSubprogramDIE(DwarfCompileUnit *TheCU,
+void DwarfDebug::constructSubprogramDIE(DwarfCompileUnit &TheCU,
const MDNode *N) {
// FIXME: We should only call this routine once, however, during LTO if a
// program is defined in multiple CUs we could end up calling it out of
const MDNode *N) {
// FIXME: We should only call this routine once, however, during LTO if a
// program is defined in multiple CUs we could end up calling it out of
DwarfCompileUnit *&CURef = SPMap[N];
if (CURef)
return;
DwarfCompileUnit *&CURef = SPMap[N];
if (CURef)
return;
DISubprogram SP(N);
if (!SP.isDefinition())
DISubprogram SP(N);
if (!SP.isDefinition())
- DIE *SubprogramDie = TheCU->getOrCreateSubprogramDIE(SP);
+ DIE *SubprogramDie = TheCU.getOrCreateSubprogramDIE(SP);
// Expose as a global name.
// Expose as a global name.
- TheCU->addGlobalName(SP.getName(), SubprogramDie, resolve(SP.getContext()));
+ TheCU.addGlobalName(SP.getName(), SubprogramDie, resolve(SP.getContext()));
-void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit *TheCU,
+void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
const MDNode *N) {
DIImportedEntity Module(N);
assert(Module.Verify());
const MDNode *N) {
DIImportedEntity Module(N);
assert(Module.Verify());
- if (DIE *D = TheCU->getOrCreateContextDIE(Module.getContext()))
+ if (DIE *D = TheCU.getOrCreateContextDIE(Module.getContext()))
constructImportedEntityDIE(TheCU, Module, D);
}
constructImportedEntityDIE(TheCU, Module, D);
}
-void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit *TheCU,
+void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
const MDNode *N, DIE *Context) {
DIImportedEntity Module(N);
assert(Module.Verify());
return constructImportedEntityDIE(TheCU, Module, Context);
}
const MDNode *N, DIE *Context) {
DIImportedEntity Module(N);
assert(Module.Verify());
return constructImportedEntityDIE(TheCU, Module, Context);
}
-void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit *TheCU,
+void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
const DIImportedEntity &Module,
DIE *Context) {
assert(Module.Verify() &&
"Use one of the MDNode * overloads to handle invalid metadata");
assert(Context && "Should always have a context for an imported_module");
const DIImportedEntity &Module,
DIE *Context) {
assert(Module.Verify() &&
"Use one of the MDNode * overloads to handle invalid metadata");
assert(Context && "Should always have a context for an imported_module");
- DIE *IMDie = TheCU->createAndAddDIE(Module.getTag(), *Context, Module);
+ DIE *IMDie = TheCU.createAndAddDIE(Module.getTag(), *Context, Module);
DIE *EntityDie;
DIDescriptor Entity = resolve(Module.getEntity());
if (Entity.isNameSpace())
DIE *EntityDie;
DIDescriptor Entity = resolve(Module.getEntity());
if (Entity.isNameSpace())
- EntityDie = TheCU->getOrCreateNameSpace(DINameSpace(Entity));
+ EntityDie = TheCU.getOrCreateNameSpace(DINameSpace(Entity));
else if (Entity.isSubprogram())
else if (Entity.isSubprogram())
- EntityDie = TheCU->getOrCreateSubprogramDIE(DISubprogram(Entity));
+ EntityDie = TheCU.getOrCreateSubprogramDIE(DISubprogram(Entity));
else if (Entity.isType())
else if (Entity.isType())
- EntityDie = TheCU->getOrCreateTypeDIE(DIType(Entity));
+ EntityDie = TheCU.getOrCreateTypeDIE(DIType(Entity));
- EntityDie = TheCU->getDIE(Entity);
- TheCU->addSourceLine(IMDie, Module.getLineNumber(),
+ EntityDie = TheCU.getDIE(Entity);
+ TheCU.addSourceLine(IMDie, Module.getLineNumber(),
Module.getContext().getFilename(),
Module.getContext().getDirectory());
Module.getContext().getFilename(),
Module.getContext().getDirectory());
- TheCU->addDIEEntry(IMDie, dwarf::DW_AT_import, EntityDie);
+ TheCU.addDIEEntry(IMDie, dwarf::DW_AT_import, EntityDie);
StringRef Name = Module.getName();
if (!Name.empty())
StringRef Name = Module.getName();
if (!Name.empty())
- TheCU->addString(IMDie, dwarf::DW_AT_name, Name);
+ TheCU.addString(IMDie, dwarf::DW_AT_name, Name);
}
// Emit all Dwarf sections that should come prior to the content. Create
}
// Emit all Dwarf sections that should come prior to the content. Create
for (MDNode *N : CU_Nodes->operands()) {
DICompileUnit CUNode(N);
for (MDNode *N : CU_Nodes->operands()) {
DICompileUnit CUNode(N);
- DwarfCompileUnit *CU = constructDwarfCompileUnit(CUNode);
+ DwarfCompileUnit &CU = constructDwarfCompileUnit(CUNode);
DIArray ImportedEntities = CUNode.getImportedEntities();
for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
ScopesWithImportedEntities.push_back(std::make_pair(
DIArray ImportedEntities = CUNode.getImportedEntities();
for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
ScopesWithImportedEntities.push_back(std::make_pair(
ScopesWithImportedEntities.end(), less_first());
DIArray GVs = CUNode.getGlobalVariables();
for (unsigned i = 0, e = GVs.getNumElements(); i != e; ++i)
ScopesWithImportedEntities.end(), less_first());
DIArray GVs = CUNode.getGlobalVariables();
for (unsigned i = 0, e = GVs.getNumElements(); i != e; ++i)
- CU->createGlobalVariableDIE(DIGlobalVariable(GVs.getElement(i)));
+ CU.createGlobalVariableDIE(DIGlobalVariable(GVs.getElement(i)));
DIArray SPs = CUNode.getSubprograms();
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
constructSubprogramDIE(CU, SPs.getElement(i));
DIArray EnumTypes = CUNode.getEnumTypes();
for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i)
DIArray SPs = CUNode.getSubprograms();
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
constructSubprogramDIE(CU, SPs.getElement(i));
DIArray EnumTypes = CUNode.getEnumTypes();
for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i)
- CU->getOrCreateTypeDIE(EnumTypes.getElement(i));
+ CU.getOrCreateTypeDIE(EnumTypes.getElement(i));
DIArray RetainedTypes = CUNode.getRetainedTypes();
for (unsigned i = 0, e = RetainedTypes.getNumElements(); i != e; ++i) {
DIType Ty(RetainedTypes.getElement(i));
// The retained types array by design contains pointers to
// MDNodes rather than DIRefs. Unique them here.
DIType UniqueTy(resolve(Ty.getRef()));
DIArray RetainedTypes = CUNode.getRetainedTypes();
for (unsigned i = 0, e = RetainedTypes.getNumElements(); i != e; ++i) {
DIType Ty(RetainedTypes.getElement(i));
// The retained types array by design contains pointers to
// MDNodes rather than DIRefs. Unique them here.
DIType UniqueTy(resolve(Ty.getRef()));
- CU->getOrCreateTypeDIE(UniqueTy);
+ CU.getOrCreateTypeDIE(UniqueTy);
}
// Emit imported_modules last so that the relevant context is already
// available.
}
// Emit imported_modules last so that the relevant context is already
// available.
assert(SPCU && "Unable to find Compile Unit!");
// FIXME: See the comment in constructSubprogramDIE about duplicate
// subprogram DIEs.
assert(SPCU && "Unable to find Compile Unit!");
// FIXME: See the comment in constructSubprogramDIE about duplicate
// subprogram DIEs.
- constructSubprogramDIE(SPCU, SP);
+ constructSubprogramDIE(*SPCU, SP);
DIE *SPDIE = SPCU->getDIE(SP);
for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) {
DIVariable DV(Variables.getElement(vi));
DIE *SPDIE = SPCU->getDIE(SP);
for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) {
DIVariable DV(Variables.getElement(vi));
// We don't keep track of which addresses are used in which CU so this
// is a bit pessimistic under LTO.
if (!InfoHolder.getAddrPool()->empty())
// We don't keep track of which addresses are used in which CU so this
// is a bit pessimistic under LTO.
if (!InfoHolder.getAddrPool()->empty())
- addSectionLabel(Asm, SkCU, SkCU->getUnitDie(),
+ addSectionLabel(*Asm, *SkCU, SkCU->getUnitDie(),
dwarf::DW_AT_GNU_addr_base, DwarfAddrSectionSym,
DwarfAddrSectionSym);
if (!TheU->getRangeLists().empty())
dwarf::DW_AT_GNU_addr_base, DwarfAddrSectionSym,
DwarfAddrSectionSym);
if (!TheU->getRangeLists().empty())
- addSectionLabel(Asm, SkCU, SkCU->getUnitDie(),
+ addSectionLabel(*Asm, *SkCU, SkCU->getUnitDie(),
dwarf::DW_AT_GNU_ranges_base,
DwarfDebugRangeSectionSym, DwarfDebugRangeSectionSym);
}
dwarf::DW_AT_GNU_ranges_base,
DwarfDebugRangeSectionSym, DwarfDebugRangeSectionSym);
}
unsigned NumRanges = TheU->getRanges().size();
if (NumRanges) {
if (NumRanges > 1) {
unsigned NumRanges = TheU->getRanges().size();
if (NumRanges) {
if (NumRanges > 1) {
- addSectionLabel(Asm, &U, U.getUnitDie(), dwarf::DW_AT_ranges,
+ addSectionLabel(*Asm, U, U.getUnitDie(), dwarf::DW_AT_ranges,
Asm->GetTempSymbol("cu_ranges", U.getUniqueID()),
DwarfDebugRangeSectionSym);
Asm->GetTempSymbol("cu_ranges", U.getUniqueID()),
DwarfDebugRangeSectionSym);
collectVariableInfo(ProcessedVars);
LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
collectVariableInfo(ProcessedVars);
LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
- DwarfCompileUnit *TheCU = SPMap.lookup(FnScope->getScopeNode());
- assert(TheCU && "Unable to find compile unit!");
+ DwarfCompileUnit &TheCU = *SPMap.lookup(FnScope->getScopeNode());
// Construct abstract scopes.
for (LexicalScope *AScope : LScopes.getAbstractScopesList()) {
// Construct abstract scopes.
for (LexicalScope *AScope : LScopes.getAbstractScopesList()) {
DIE *CurFnDIE = constructScopeDIE(TheCU, FnScope);
if (!CurFn->getTarget().Options.DisableFramePointerElim(*CurFn))
DIE *CurFnDIE = constructScopeDIE(TheCU, FnScope);
if (!CurFn->getTarget().Options.DisableFramePointerElim(*CurFn))
- TheCU->addFlag(CurFnDIE, dwarf::DW_AT_APPLE_omit_frame_ptr);
+ TheCU.addFlag(CurFnDIE, dwarf::DW_AT_APPLE_omit_frame_ptr);
// Add the range of this function to the list of ranges for the CU.
RangeSpan Span(FunctionBeginSym, FunctionEndSym);
// Add the range of this function to the list of ranges for the CU.
RangeSpan Span(FunctionBeginSym, FunctionEndSym);
- TheCU->addRange(std::move(Span));
+ TheCU.addRange(std::move(Span));
PrevSection = Asm->getCurrentSection();
PrevSection = Asm->getCurrentSection();
// Clear debug info
for (auto &I : ScopeVariables)
// Clear debug info
for (auto &I : ScopeVariables)
// DWARF5 Experimental Separate Dwarf emitters.
// DWARF5 Experimental Separate Dwarf emitters.
-void DwarfDebug::initSkeletonUnit(const DwarfUnit *U, DIE *Die,
- DwarfUnit *NewU) {
+void DwarfDebug::initSkeletonUnit(const DwarfUnit &U, DIE *Die,
+ std::unique_ptr<DwarfUnit> NewU) {
NewU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
NewU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
- U->getCUNode().getSplitDebugFilename());
+ U.getCUNode().getSplitDebugFilename());
if (!CompilationDir.empty())
NewU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
if (!CompilationDir.empty())
NewU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
- addGnuPubAttributes(NewU, Die);
+ addGnuPubAttributes(*NewU, Die);
- SkeletonHolder.addUnit(NewU);
+ SkeletonHolder.addUnit(std::move(NewU));
}
// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
// DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
// DW_AT_addr_base, DW_AT_ranges_base.
}
// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
// DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
// DW_AT_addr_base, DW_AT_ranges_base.
-DwarfCompileUnit *DwarfDebug::constructSkeletonCU(const DwarfCompileUnit *CU) {
+DwarfCompileUnit &DwarfDebug::constructSkeletonCU(const DwarfCompileUnit &CU) {
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
- DwarfCompileUnit *NewCU = new DwarfCompileUnit(
- CU->getUniqueID(), Die, CU->getCUNode(), Asm, this, &SkeletonHolder);
- NewCU->initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
+ auto OwnedUnit = make_unique<DwarfCompileUnit>(
+ CU.getUniqueID(), Die, CU.getCUNode(), Asm, this, &SkeletonHolder);
+ DwarfCompileUnit &NewCU = *OwnedUnit;
+ NewCU.initSection(Asm->getObjFileLowering().getDwarfInfoSection(),
- NewCU->initStmtList(DwarfLineSectionSym);
+ NewCU.initStmtList(DwarfLineSectionSym);
- initSkeletonUnit(CU, Die, NewCU);
+ initSkeletonUnit(CU, Die, std::move(OwnedUnit));
return NewCU;
}
// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_dwo_name,
// DW_AT_addr_base.
return NewCU;
}
// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_dwo_name,
// DW_AT_addr_base.
-DwarfTypeUnit *DwarfDebug::constructSkeletonTU(DwarfTypeUnit *TU) {
+DwarfTypeUnit &DwarfDebug::constructSkeletonTU(DwarfTypeUnit &TU) {
DwarfCompileUnit &CU = static_cast<DwarfCompileUnit &>(
DwarfCompileUnit &CU = static_cast<DwarfCompileUnit &>(
- *SkeletonHolder.getUnits()[TU->getCU().getUniqueID()]);
+ *SkeletonHolder.getUnits()[TU.getCU().getUniqueID()]);
DIE *Die = new DIE(dwarf::DW_TAG_type_unit);
DIE *Die = new DIE(dwarf::DW_TAG_type_unit);
- DwarfTypeUnit *NewTU =
- new DwarfTypeUnit(TU->getUniqueID(), Die, CU, Asm, this, &SkeletonHolder);
- NewTU->setTypeSignature(TU->getTypeSignature());
- NewTU->setType(NULL);
- NewTU->initSection(
- Asm->getObjFileLowering().getDwarfTypesSection(TU->getTypeSignature()));
-
- initSkeletonUnit(TU, Die, NewTU);
+ auto OwnedUnit = make_unique<DwarfTypeUnit>(TU.getUniqueID(), Die, CU, Asm,
+ this, &SkeletonHolder);
+ DwarfTypeUnit &NewTU = *OwnedUnit;
+ NewTU.setTypeSignature(TU.getTypeSignature());
+ NewTU.setType(NULL);
+ NewTU.initSection(
+ Asm->getObjFileLowering().getDwarfTypesSection(TU.getTypeSignature()));
+
+ initSkeletonUnit(TU, Die, std::move(OwnedUnit));
}
DIE *UnitDie = new DIE(dwarf::DW_TAG_type_unit);
}
DIE *UnitDie = new DIE(dwarf::DW_TAG_type_unit);
- DwarfTypeUnit *NewTU =
- new DwarfTypeUnit(InfoHolder.getUnits().size(), UnitDie, CU, Asm, this,
- &InfoHolder, getDwoLineTable(CU));
- TU = NewTU;
- InfoHolder.addUnit(NewTU);
-
- NewTU->addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
+ auto OwnedUnit =
+ make_unique<DwarfTypeUnit>(InfoHolder.getUnits().size(), UnitDie, CU, Asm,
+ this, &InfoHolder, getDwoLineTable(CU));
+ DwarfTypeUnit &NewTU = *OwnedUnit;
+ TU = &NewTU;
+ InfoHolder.addUnit(std::move(OwnedUnit));
+
+ NewTU.addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
CU.getLanguage());
MD5 Hash;
CU.getLanguage());
MD5 Hash;
MD5::MD5Result Result;
Hash.final(Result);
uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8);
MD5::MD5Result Result;
Hash.final(Result);
uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8);
- NewTU->setTypeSignature(Signature);
+ NewTU.setTypeSignature(Signature);
- NewTU->setSkeleton(constructSkeletonTU(NewTU));
+ NewTU.setSkeleton(constructSkeletonTU(NewTU));
else
CU.applyStmtList(*UnitDie);
else
CU.applyStmtList(*UnitDie);
- NewTU->setType(NewTU->createTypeDIE(CTy));
+ NewTU.setType(NewTU.createTypeDIE(CTy));
useSplitDwarf()
? Asm->getObjFileLowering().getDwarfTypesDWOSection(Signature)
: Asm->getObjFileLowering().getDwarfTypesSection(Signature));
useSplitDwarf()
? Asm->getObjFileLowering().getDwarfTypesDWOSection(Signature)
: Asm->getObjFileLowering().getDwarfTypesSection(Signature));
- CU.addDIETypeSignature(RefDie, *NewTU);
+ CU.addDIETypeSignature(RefDie, NewTU);
-void DwarfDebug::attachLowHighPC(DwarfCompileUnit *Unit, DIE *D,
+void DwarfDebug::attachLowHighPC(DwarfCompileUnit &Unit, DIE *D,
MCSymbol *Begin, MCSymbol *End) {
MCSymbol *Begin, MCSymbol *End) {
- Unit->addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
+ Unit.addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
- Unit->addLabelAddress(D, dwarf::DW_AT_high_pc, End);
+ Unit.addLabelAddress(D, dwarf::DW_AT_high_pc, End);
- Unit->addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
+ Unit.addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
#include "llvm/MC/MCDwarf.h"
#include "llvm/Support/Allocator.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/Support/Allocator.h"
namespace llvm {
class AsmPrinter;
namespace llvm {
class AsmPrinter;
void assignAbbrevNumber(DIEAbbrev &Abbrev);
/// \brief Add a unit to the list of CUs.
void assignAbbrevNumber(DIEAbbrev &Abbrev);
/// \brief Add a unit to the list of CUs.
- void addUnit(DwarfUnit *CU);
+ void addUnit(std::unique_ptr<DwarfUnit> U);
/// \brief Emit all of the units to the section listed with the given
/// abbreviation section.
/// \brief Emit all of the units to the section listed with the given
/// abbreviation section.
/// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
/// variables in this scope then create and insert DIEs for these
/// variables.
/// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
/// variables in this scope then create and insert DIEs for these
/// variables.
- DIE *updateSubprogramScopeDIE(DwarfCompileUnit *SPCU, DISubprogram SP);
+ DIE *updateSubprogramScopeDIE(DwarfCompileUnit &SPCU, DISubprogram SP);
/// \brief A helper function to check whether the DIE for a given Scope is
/// going to be null.
/// \brief A helper function to check whether the DIE for a given Scope is
/// going to be null.
/// \brief A helper function to construct a RangeSpanList for a given
/// lexical scope.
/// \brief A helper function to construct a RangeSpanList for a given
/// lexical scope.
- void addScopeRangeList(DwarfCompileUnit *TheCU, DIE *ScopeDIE,
+ void addScopeRangeList(DwarfCompileUnit &TheCU, DIE *ScopeDIE,
const SmallVectorImpl<InsnRange> &Range);
/// \brief Construct new DW_TAG_lexical_block for this scope and
/// attach DW_AT_low_pc/DW_AT_high_pc labels.
const SmallVectorImpl<InsnRange> &Range);
/// \brief Construct new DW_TAG_lexical_block for this scope and
/// attach DW_AT_low_pc/DW_AT_high_pc labels.
- DIE *constructLexicalScopeDIE(DwarfCompileUnit *TheCU, LexicalScope *Scope);
+ DIE *constructLexicalScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope);
/// \brief This scope represents inlined body of a function. Construct
/// DIE to represent this concrete inlined copy of the function.
/// \brief This scope represents inlined body of a function. Construct
/// DIE to represent this concrete inlined copy of the function.
- DIE *constructInlinedScopeDIE(DwarfCompileUnit *TheCU, LexicalScope *Scope);
+ DIE *constructInlinedScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope);
/// \brief Construct a DIE for this scope.
/// \brief Construct a DIE for this scope.
- DIE *constructScopeDIE(DwarfCompileUnit *TheCU, LexicalScope *Scope);
+ DIE *constructScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope);
/// A helper function to create children of a Scope DIE.
/// A helper function to create children of a Scope DIE.
- DIE *createScopeChildrenDIE(DwarfCompileUnit *TheCU, LexicalScope *Scope,
+ DIE *createScopeChildrenDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope,
SmallVectorImpl<DIE *> &Children);
/// \brief Emit initial Dwarf sections with a label at the start of each one.
SmallVectorImpl<DIE *> &Children);
/// \brief Emit initial Dwarf sections with a label at the start of each one.
/// DWARF 5 Experimental Split Dwarf Emitters
/// \brief Initialize common features of skeleton units.
/// DWARF 5 Experimental Split Dwarf Emitters
/// \brief Initialize common features of skeleton units.
- void initSkeletonUnit(const DwarfUnit *U, DIE *Die, DwarfUnit *NewU);
+ void initSkeletonUnit(const DwarfUnit &U, DIE *Die,
+ std::unique_ptr<DwarfUnit> NewU);
/// \brief Construct the split debug info compile unit for the debug info
/// section.
/// \brief Construct the split debug info compile unit for the debug info
/// section.
- DwarfCompileUnit *constructSkeletonCU(const DwarfCompileUnit *CU);
+ DwarfCompileUnit &constructSkeletonCU(const DwarfCompileUnit &CU);
/// \brief Construct the split debug info compile unit for the debug info
/// section.
/// \brief Construct the split debug info compile unit for the debug info
/// section.
- DwarfTypeUnit *constructSkeletonTU(DwarfTypeUnit *TU);
+ DwarfTypeUnit &constructSkeletonTU(DwarfTypeUnit &TU);
/// \brief Emit the debug info dwo section.
void emitDebugInfoDWO();
/// \brief Emit the debug info dwo section.
void emitDebugInfoDWO();
/// Flags to let the linker know we have emitted new style pubnames. Only
/// emit it here if we don't have a skeleton CU for split dwarf.
/// Flags to let the linker know we have emitted new style pubnames. Only
/// emit it here if we don't have a skeleton CU for split dwarf.
- void addGnuPubAttributes(DwarfUnit *U, DIE *D) const;
+ void addGnuPubAttributes(DwarfUnit &U, DIE *D) const;
/// \brief Create new DwarfCompileUnit for the given metadata node with tag
/// DW_TAG_compile_unit.
/// \brief Create new DwarfCompileUnit for the given metadata node with tag
/// DW_TAG_compile_unit.
- DwarfCompileUnit *constructDwarfCompileUnit(DICompileUnit DIUnit);
+ DwarfCompileUnit &constructDwarfCompileUnit(DICompileUnit DIUnit);
/// \brief Construct subprogram DIE.
/// \brief Construct subprogram DIE.
- void constructSubprogramDIE(DwarfCompileUnit *TheCU, const MDNode *N);
+ void constructSubprogramDIE(DwarfCompileUnit &TheCU, const MDNode *N);
/// \brief Construct imported_module or imported_declaration DIE.
/// \brief Construct imported_module or imported_declaration DIE.
- void constructImportedEntityDIE(DwarfCompileUnit *TheCU, const MDNode *N);
+ void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N);
/// \brief Construct import_module DIE.
/// \brief Construct import_module DIE.
- void constructImportedEntityDIE(DwarfCompileUnit *TheCU, const MDNode *N,
+ void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N,
DIE *Context);
/// \brief Construct import_module DIE.
DIE *Context);
/// \brief Construct import_module DIE.
- void constructImportedEntityDIE(DwarfCompileUnit *TheCU,
+ void constructImportedEntityDIE(DwarfCompileUnit &TheCU,
const DIImportedEntity &Module, DIE *Context);
/// \brief Register a source line with debug info. Returns the unique
const DIImportedEntity &Module, DIE *Context);
/// \brief Register a source line with debug info. Returns the unique
/// \brief Return Label immediately following the instruction.
MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
/// \brief Return Label immediately following the instruction.
MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
- void attachLowHighPC(DwarfCompileUnit *Unit, DIE *D, MCSymbol *Begin,
+ void attachLowHighPC(DwarfCompileUnit &Unit, DIE *D, MCSymbol *Begin,
virtual ~DwarfUnit();
/// Set the skeleton unit associated with this unit.
virtual ~DwarfUnit();
/// Set the skeleton unit associated with this unit.
- void setSkeleton(DwarfUnit *Skel) { Skeleton = Skel; }
+ void setSkeleton(DwarfUnit &Skel) { Skeleton = &Skel; }
/// Get the skeleton unit associated with this unit.
DwarfUnit *getSkeleton() const { return Skeleton; }
/// Get the skeleton unit associated with this unit.
DwarfUnit *getSkeleton() const { return Skeleton; }