Skip to content

Commit ce96c26

Browse files
authored
Revert "[llvm][DebugInfo] Attach object-pointer to DISubprogram declarations (#122742)" (#124853)
This introduces a substantial (5-10%) regression in .debug_info size, so we're discussing alternatives in #122742 and #124790. This reverts commit 7c72941.
1 parent 4573c85 commit ce96c26

File tree

6 files changed

+2555
-2604
lines changed

6 files changed

+2555
-2604
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
849849
}
850850
}
851851

852-
DIE *DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
853-
// Args[0] is the return type.
854-
DIE *ObjectPointer = nullptr;
852+
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
855853
for (unsigned i = 1, N = Args.size(); i < N; ++i) {
856854
const DIType *Ty = Args[i];
857855
if (!Ty) {
@@ -862,14 +860,8 @@ DIE *DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
862860
addType(Arg, Ty);
863861
if (Ty->isArtificial())
864862
addFlag(Arg, dwarf::DW_AT_artificial);
865-
if (Ty->isObjectPointer()) {
866-
assert(!ObjectPointer && "Can't have more than one object pointer");
867-
ObjectPointer = &Arg;
868-
}
869863
}
870864
}
871-
872-
return ObjectPointer;
873865
}
874866

875867
void DwarfUnit::constructTypeDIE(DIE &Buffer, const DISubroutineType *CTy) {
@@ -1366,8 +1358,7 @@ void DwarfUnit::applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie,
13661358

13671359
// Add arguments. Do not add arguments for subprogram definition. They will
13681360
// be handled while processing variables.
1369-
if (auto *ObjectPointer = constructSubprogramArguments(SPDie, Args))
1370-
addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, *ObjectPointer);
1361+
constructSubprogramArguments(SPDie, Args);
13711362
}
13721363

13731364
addThrownTypes(SPDie, SP->getThrownTypes());

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ class DwarfUnit : public DIEUnit {
268268
void constructContainingTypeDIEs();
269269

270270
/// Construct function argument DIEs.
271-
///
272-
/// \returns DIE of the object pointer if one exists. Nullptr otherwise.
273-
DIE *constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args);
271+
void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args);
274272

275273
/// Create a DIE with the given Tag, add the DIE to its parent, and
276274
/// call insertDIE if MD is not null.

0 commit comments

Comments
 (0)