This is an archive of the discontinued LLVM Phabricator instance.

[llvm][DebugInfo] Emit DW_AT_defaulted for defaulted C++ member functions
Needs ReviewPublic

Authored by Michael137 on Jun 20 2023, 8:49 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:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2023, 8:49 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Michael137 requested review of this revision.Jun 20 2023, 8:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2023, 8:49 AM
dblaikie added inline comments.Jun 20 2023, 1:29 PM
llvm/include/llvm/IR/DebugInfoFlags.def
94–95

Is there any particular benefit to providing this fidelity (the difference between defaulted in class and defaulted out of class)? (sorry, this might split the "motivation" design discussion between this patch and the clang frontend patch) and/or should we use an enum here (it wouldn't save us a bit, but would avoid create a representation that could have both DefaultedInClass and DefaultedOutOfClass true at the same time, which isn't necessary/useful)