Biohazrd
Biohazrd copied to clipboard
Better support for template metadata and function templates
Right now reading template-related information is difficult to do since you end up having to deal with low-level Clang details. We should expose template-related concepts in a way that makes it possible for specialized generators to inspect them.
- [ ]
TranslatedTemplateSpecialization
should expose the parameters used for the template. - [ ]
TemplateSpecializationType
should be reduced to a type which allows you to inspect the template paramers- Need to decide if this should only happen when template support is disabled or if we want a specialization of
TranslatedTypeReference
for templates. - We could also have a special type which has a
TranslatedTypeReference
and the parameter-related metadata, but that makes walking the type tree more difficult for consumers because they have to handle this edge case.
- Need to decide if this should only happen when template support is disabled or if we want a specialization of
- [x] Add an abstract
TranslatedTemplate
declaration type which exposes the concept of an uninitialized template.- For now these would just be for inspection purposes. In the future we might expose the ability to explicitly specialize the template.
- [ ] Decide if types inheriting from this type should cause diagnostics. (On one hand it'd help discover why templates without any instantiations are not in the output, on the other hand it's noise in projects where it doesn't matter.)
- [x] Add a
TranslatedRecordTemplate
inheriting fromTranslatedTemplate
to represent record templates.- [ ]
TranslatedTemplateSpecialization
should be updated to reference the template
- [ ]
- [x] Add a
TranslatedFunctionTemplate
inheriting fromTranslatedTemplate
to represent function templates.
- [ ] Add
TranslatedFunctionTemplateSpecialization
inheriting fromTranslatedFunction
which similar toTranslatedTemplateSpecialization
represents a specific function specialization.- [ ] Consider renaming
TranslatedTemplateSpecialization
toTranslatedRecordTemplateSpecialization
.
- [ ] Consider renaming