This implements the DWARF 5 feature described at
http://www.dwarfstd.org/ShowIssue.php?issue=141215.1
This allows a consumer to understand whether a composite data type is
trivially copyable and thus should be passed by value instead of by
reference. The canonical example is being able to distinguish the
following two types:
// S is not trivially copyable because of the explicit destructor. struct S { ~S() {} }; // T is a POD type. struct T { ~T() = default; };
To avoid bloating the debug info with calling convention attributes,
this patch only adds them were the calling convention is not obvious
from the context.
Implicitly by value is everything that clearly looks like a C struct, i.e.:
- Non-C++ record types.
- Types that define none of destructor, copy/move constructor, copy/move assignment operator.
Implicitly by reference is everything clearly looks like a non-pod type:
- Types that define a destructor, a copy constructor, and a copy assignment operator.