Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for template metadata and function templates #247

Open
3 of 9 tasks
PathogenDavid opened this issue Jun 28, 2022 · 0 comments
Open
3 of 9 tasks

Better support for template metadata and function templates #247

PathogenDavid opened this issue Jun 28, 2022 · 0 comments
Labels
Area-Translation Issues concerning the translation from libclang into Biohazrd Blocks-ImPlot Concept-ApiClarity Issues for improving the clarity of the Biohazrd API Concept-TemplateSupport Issues concerning how Biohazrd handles C++ templates

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Jun 28, 2022

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.
  • 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.)
    • Add a TranslatedRecordTemplate inheriting from TranslatedTemplate to represent record templates.
      • TranslatedTemplateSpecialization should be updated to reference the template
    • Add a TranslatedFunctionTemplate inheriting from TranslatedTemplate to represent function templates.
  • Add TranslatedFunctionTemplateSpecialization inheriting from TranslatedFunction which similar to TranslatedTemplateSpecialization represents a specific function specialization.
    • Consider renaming TranslatedTemplateSpecialization to TranslatedRecordTemplateSpecialization.
@PathogenDavid PathogenDavid added Area-Translation Issues concerning the translation from libclang into Biohazrd Concept-ApiClarity Issues for improving the clarity of the Biohazrd API Concept-TemplateSupport Issues concerning how Biohazrd handles C++ templates Blocks-ImPlot labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Translation Issues concerning the translation from libclang into Biohazrd Blocks-ImPlot Concept-ApiClarity Issues for improving the clarity of the Biohazrd API Concept-TemplateSupport Issues concerning how Biohazrd handles C++ templates
Projects
None yet
Development

No branches or pull requests

1 participant