This is an archive of the discontinued LLVM Phabricator instance.

[clang][DebugInfo] Emit DW_AT_deleted on any deleted member function
ClosedPublic

Authored by Michael137 on Jun 19 2023, 8:06 AM.

Details

Summary

Currently we emit DW_AT_deleted for deleted special-member
functions (i.e., ctors/dtors). However, in C++ one can mark any
member function as deleted. This patch expands the set of member
functions for which we emit DW_AT_deleted.

The DWARFv5 spec section 5.7.8 says:

<non-normative>
In C++, a member function may be declared as deleted. This prevents the compiler from
generating a default implementation of a special member function such as a constructor
or destructor, and can affect overload resolution when used on other member functions.
</non-normative>

If the member function entry has been declared as deleted, then that entry has a
DW_AT_deleted attribute.

Thus this change is conforming.

Diff Detail

Event Timeline

Michael137 created this revision.Jun 19 2023, 8:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 8:06 AM
Michael137 requested review of this revision.Jun 19 2023, 8:06 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 19 2023, 8:06 AM
  • fix test comment
aprantl accepted this revision.Jun 19 2023, 9:10 AM

Since a boolean flag is effectively free in DWARF as it can be stored in the abbreviations, this looks like a good change to me.

This revision is now accepted and ready to land.Jun 19 2023, 9:10 AM