-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
cbuilder: ccgexprs sweep part 1, basic if stmts #24381
Conversation
The code blow up is too much, use more helper procs please. |
The call & assignment builders have prebuilt argument versions now that are more readable but need more strings to be built, albeit not large ones. Some extra helpers are also added to deal with code duplication. Let me know if it's still not readable enough. |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
Doing this early is useful so we can move the indentation logic into `Builder` itself rather than mix it with the block logic in `ccgstmts` (the `if` statements in #24381 have not been indented properly either). However it also means `Builder` is now used for code that still generates raw C code, so the diff won't be as clean when these get updated.
Finishes `genEnumInfo` as followup to #24351. As #24381 mentions this covers every use of `for` loops in the codegen. --------- Co-authored-by: Andreas Rumpf <[email protected]>
Most of what ccgexprs uses is now ported to cbuilder, so this PR makes around ~25% of ccgexprs use it, along with adding
if
stmts (nowhile
/switch
andfor
which is only used asfor (tmp = a; tmp < b; tmp++)
). Theif
builder does not add indents for blocks since we can't makeBuilder
an object yet rather than an alias tostring
, this will likely be one of the last refactors.Somewhat unrelated but
ccgtypes
is not ready yet because proc signatures are not implemented.