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

Draft bootstrap decl #1918

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

duckdoom5
Copy link
Contributor

@duckdoom5 duckdoom5 commented Mar 1, 2025

Okay so I managed to generate a Declaration.h file from clang source, but I'm a bit stuck.

  • Some properties from clang are missed due to parsing/converter issues
  • Some fields should be removed since they can be mapped to simple functions
  • The original decl types add a bunch of properties that no longer exist

Since they don't really match, it's not easy to map the new data to the old one. I'm not sure how to go from here.. I kinda need this new data to properly support everything and implement the recursive AST visitor we talked about before.

I feel like the only way to get this done is to slowly convert each of the original decls to the new version, but I also don't want to waste time. Any suggestions/ideas to reduce the amount of time required for this task?

Note: This code is my first pass! Definitely not ready for review XD

@duckdoom5 duckdoom5 marked this pull request as draft March 1, 2025 13:39
@duckdoom5 duckdoom5 force-pushed the feat/bootstrap-everything branch from 4070b93 to 92e3498 Compare March 1, 2025 13:44
@tritao
Copy link
Collaborator

tritao commented Mar 1, 2025

I guess first let me ask you what do you hope to get out of this change.

Is this mainly to be able to use the Clang's Recursive AST visitor, and as such try to minimize the risk of crashes we have in complex where our walking of Clang AST might be erronous / incomplete?

Is there some other advantages you are thinking about?

@duckdoom5
Copy link
Contributor Author

duckdoom5 commented Mar 1, 2025

It's 3 things really:

  • Add properties we are missing currently
    • With those added, we'd be able to use clang's implementation of the AST dumper, which means we'll have a complete AST
  • Future proofing
    • C++23 is around the corner. If we have this generator automated, it should be a click of a button and maybe some fixes to add support for new language features. We kinda already see this happening now, where C++20 features are not really supported
  • Avoid implementation bugs.
    • Make sure the properties are actually set.
      While working on this, I found that a bunch of properties that are available on the C# side are never assigned to (eg. Class.IsStatic and Class.TemplateParameters are never assigned to, but are used throughout the codebase a lot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants