-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
builder,checker,ast: move auto str() before backend gen #25857
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
base: master
Are you sure you want to change the base?
Conversation
|
@kbkpbot I just want to thank you in advance, for your continuing work on this 🙇🏻 . |
|
Most of the failures appear to be "strings imported but never used"... |
There are some bugs in the code, and need more fix. Currently, I am working on PR #26079, this will enable cast alias in |
Feature request by #25826
This PR aims to decouple the
auto_str()function from individual backend generators and move it to the frontend. This way, each backend can remove its ownauto_str()implementation.The general approach is to introduce a new phase,
gen_auto_fn()in thebuilder—after thecheckerand before code generation. This phase leverages the results from thecheckerandmarkusedto identify which types require theauto_str()function. It then manually creates these virtual functions, processes them usingparser.parse_text(), and performs checks viacheck(). The output is subsequently passed to the respective backends for code generation.Currently, only the generation of
auto_str()for structs is supported. Future extensions may include support for otherstr()functions, with the ultimate goal of fully migrating this functionality to the frontend.