Skip to content

Revert "[llvm][DebugInfo] Attach object-pointer to DISubprogram declarations (#122742)" #124853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
}
}

DIE *DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
// Args[0] is the return type.
DIE *ObjectPointer = nullptr;
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
for (unsigned i = 1, N = Args.size(); i < N; ++i) {
const DIType *Ty = Args[i];
if (!Ty) {
Expand All @@ -862,14 +860,8 @@ DIE *DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
addType(Arg, Ty);
if (Ty->isArtificial())
addFlag(Arg, dwarf::DW_AT_artificial);
if (Ty->isObjectPointer()) {
assert(!ObjectPointer && "Can't have more than one object pointer");
ObjectPointer = &Arg;
}
}
}

return ObjectPointer;
}

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

// Add arguments. Do not add arguments for subprogram definition. They will
// be handled while processing variables.
if (auto *ObjectPointer = constructSubprogramArguments(SPDie, Args))
addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, *ObjectPointer);
constructSubprogramArguments(SPDie, Args);
}

addThrownTypes(SPDie, SP->getThrownTypes());
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ class DwarfUnit : public DIEUnit {
void constructContainingTypeDIEs();

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

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