Description
Section 5.5.8 Class Template Instantiations
of the DWARF 4 standard says:
A class template instantiation is represented by a debugging information entry with the tag DW_TAG_class_type, DW_TAG_structure_type or DW_TAG_union_type. With five exceptions, such an entry will contain the same attributes and have the same types of child entries as would an entry for a class type defined explicitly using the instantiation types and values.
and later (two of the five mentioned exceptions):
Each formal parameterized type declaration appearing in the template definition is
represented by a debugging information entry with the tag DW_TAG_template_type_parameter. [...]The class type entry and each of its child entries references a template type parameter entry in any circumstance where the source template definition references a formal parameterized type. [...]
These things are not done yet: For generic types we describe their monomorphized version, losing the information that they stem from a generic definition. In order to fix this issue, the following two things need to be done:
- Create
DW_TAG_template_type_parameter
metadata entries for each generic parameter like already done for generic functions. - Reference these metadata entries where they are use in the type definition---instead of directly referencing the type they have been substituted by.