Skip to content

Commit e29552c

Browse files
committed
Revert "[DWARF] Create subprogram's DIE in DISubprogram's unit"
This reverts commit ef0dcb5. This change is causing a lot of compiler crashes inside, sorry I don't have a small repro/stacktrace with symbols to share right now. Differential Revision: https://reviews.llvm.org/D95622
1 parent f84efe9 commit e29552c

File tree

3 files changed

+5
-103
lines changed

3 files changed

+5
-103
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,9 @@ class DwarfDebug : public DebugHandlerBase {
466466
/// Construct a DIE for this abstract scope.
467467
void constructAbstractSubprogramScopeDIE(DwarfCompileUnit &SrcCU, LexicalScope *Scope);
468468

469+
/// Construct a DIE for the subprogram definition \p SP and return it.
470+
DIE &constructSubprogramDefinitionDIE(const DISubprogram *SP);
471+
469472
/// Construct DIEs for call site entries describing the calls in \p MF.
470473
void constructCallSiteEntryDIEs(const DISubprogram &SP, DwarfCompileUnit &CU,
471474
DIE &ScopeDIE, const MachineFunction &MF);
@@ -763,9 +766,6 @@ class DwarfDebug : public DebugHandlerBase {
763766
/// * DW_FORM_data4 for 32-bit DWARFv3 and DWARFv2.
764767
dwarf::Form getDwarfSectionOffsetForm() const;
765768

766-
/// Construct a DIE for the subprogram definition \p SP and return it.
767-
DIE &constructSubprogramDefinitionDIE(const DISubprogram *SP);
768-
769769
/// Returns the previous CU that was being updated
770770
const DwarfCompileUnit *getPrevCU() const { return PrevCU; }
771771
void setPrevCU(const DwarfCompileUnit *PrevCU) { this->PrevCU = PrevCU; }

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,8 @@ DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) {
545545
return getOrCreateTypeDIE(T);
546546
if (auto *NS = dyn_cast<DINamespace>(Context))
547547
return getOrCreateNameSpace(NS);
548-
if (auto *SP = dyn_cast<DISubprogram>(Context)) {
549-
// Subprogram definitions should be created in the Unit that they specify,
550-
// which might not be "this" unit when type definitions move around under
551-
// LTO.
552-
assert(SP->isDefinition());
553-
return &DD->constructSubprogramDefinitionDIE(SP);
554-
}
548+
if (auto *SP = dyn_cast<DISubprogram>(Context))
549+
return getOrCreateSubprogramDIE(SP);
555550
if (auto *M = dyn_cast<DIModule>(Context))
556551
return getOrCreateModule(M);
557552
return getDIE(Context);

llvm/test/DebugInfo/X86/subprogram-across-cus.ll

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)