This is an archive of the discontinued LLVM Phabricator instance.

[clang][DebugInfo] Emit DW_AT_defaulted for defaulted C++ member functions
AcceptedPublic

Authored by Michael137 on Jun 20 2023, 8:31 AM.

Details

Reviewers
dblaikie
aprantl
Summary

This patch implements the DWARFv5 feature where a
DW_AT_defaulted is attached to DW_TAG_subprograms
which are explicitly defaulted in C++, i.e., member
functions such as the following:

class C {
  C() = default;
  ~C() = default;
};

We add two new spFlags, one for each possible value of
DW_AT_defaulted (see table in section 5.7.8 of DWARFv5
specification).

Diff Detail

Event Timeline

Michael137 created this revision.Jun 20 2023, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2023, 8:31 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Michael137 requested review of this revision.Jun 20 2023, 8:31 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 20 2023, 8:31 AM
  • remove redundant includes
  • clang-format

Any particular use for this debug info in DWARF consumers?

aprantl accepted this revision.Jun 20 2023, 1:57 PM

Not sure if this is the driving motivation, but this would probably allow LLDB's expression evaluator to synthesize a default implementation for these functions if they were optimized away.

clang/test/CodeGenCXX/debug-info-defaulted.cpp
31

typo: defaulted

This revision is now accepted and ready to land.Jun 20 2023, 1:57 PM