Skip to content

Commit 6a248cb

Browse files
committed
moved call inside addDwarfTypeUnitType
1 parent c215eea commit 6a248cb

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3704,19 +3704,19 @@ uint64_t DwarfDebug::makeTypeSignature(StringRef Identifier) {
37043704
return Result.high();
37053705
}
37063706

3707-
bool DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
3707+
void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
37083708
StringRef Identifier, DIE &RefDie,
37093709
const DICompositeType *CTy) {
37103710
// Fast path if we're building some type units and one has already used the
37113711
// address pool we know we're going to throw away all this work anyway, so
37123712
// don't bother building dependent types.
37133713
if (!TypeUnitsUnderConstruction.empty() && AddrPool.hasBeenUsed())
3714-
return false;
3714+
return;
37153715

37163716
auto Ins = TypeSignatures.insert(std::make_pair(CTy, 0));
37173717
if (!Ins.second) {
37183718
CU.addDIETypeSignature(RefDie, Ins.first->second);
3719-
return false;
3719+
return;
37203720
}
37213721

37223722
setCurrentDWARF5AccelTable(DWARF5AccelTableKind::TU);
@@ -3789,7 +3789,8 @@ bool DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
37893789
// they depend on addresses, throwing them out and rebuilding them.
37903790
setCurrentDWARF5AccelTable(DWARF5AccelTableKind::CU);
37913791
CU.constructTypeDIE(RefDie, cast<DICompositeType>(CTy));
3792-
return true;
3792+
CU.updateAcceleratorTables(CTy->getScope(), CTy, RefDie);
3793+
return;
37933794
}
37943795

37953796
// If the type wasn't dependent on fission addresses, finish adding the type
@@ -3811,7 +3812,7 @@ bool DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
38113812
setCurrentDWARF5AccelTable(DWARF5AccelTableKind::CU);
38123813
}
38133814
CU.addDIETypeSignature(RefDie, Signature);
3814-
return false;
3815+
return;
38153816
}
38163817

38173818
// Add the Name along with its companion DIE to the appropriate accelerator

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,7 @@ class DwarfDebug : public DebugHandlerBase {
744744

745745
/// Add a DIE to the set of types that we're going to pull into
746746
/// type units.
747-
/// Returns true if TU creation fails, and type was emitted in the CU.
748-
bool addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier,
747+
void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier,
749748
DIE &Die, const DICompositeType *CTy);
750749

751750
/// Add a label so that arange data can be generated for it.

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,7 @@ DIE *DwarfUnit::createTypeDIE(const DIScope *Context, DIE &ContextDIE,
589589
// Skip updating the accelerator tables since this is not the full type.
590590
if (MDString *TypeId = CTy->getRawIdentifier()) {
591591
addGlobalType(Ty, TyDIE, Context);
592-
if (DD->addDwarfTypeUnitType(getCU(), TypeId->getString(), TyDIE, CTy))
593-
updateAcceleratorTables(Context, Ty, TyDIE);
592+
DD->addDwarfTypeUnitType(getCU(), TypeId->getString(), TyDIE, CTy);
594593
} else {
595594
updateAcceleratorTables(Context, Ty, TyDIE);
596595
finishNonUnitTypeDIE(TyDIE, CTy);

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ class DwarfUnit : public DIEUnit {
315315
/// Get context owner's DIE.
316316
DIE *createTypeDIE(const DICompositeType *Ty);
317317

318+
/// If this is a named finished type then include it in the list of types for
319+
/// the accelerator tables.
320+
void updateAcceleratorTables(const DIScope *Context, const DIType *Ty,
321+
const DIE &TyDIE);
322+
318323
protected:
319324
~DwarfUnit();
320325

@@ -357,11 +362,6 @@ class DwarfUnit : public DIEUnit {
357362

358363
virtual void finishNonUnitTypeDIE(DIE& D, const DICompositeType *CTy) = 0;
359364

360-
/// If this is a named finished type then include it in the list of types for
361-
/// the accelerator tables.
362-
void updateAcceleratorTables(const DIScope *Context, const DIType *Ty,
363-
const DIE &TyDIE);
364-
365365
virtual bool isDwoUnit() const = 0;
366366
const MCSymbol *getCrossSectionRelativeBaseAddress() const override;
367367

0 commit comments

Comments
 (0)