-
Notifications
You must be signed in to change notification settings - Fork 745
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
Reset function context when ending a function in IRBuilder #7081
Merged
+20
−10
Commits on Nov 15, 2024
-
Use empty blocks instead of nops for empty scopes in IRBuilder
When IRBuilder builds an empty non-block scope such as a function body, an if arm, a try block, etc, it needs to produce some expression to represent the empty contents. Previously it produced a nop, but change it to produce an empty block instead. The binary writer and printer have special logic to elide empty blocks, so this produces smaller output. Update J2CLOpts to recognize functions containing empty blocks as trivial to avoid regressing one of its tests.
Configuration menu - View commit details
-
Copy full SHA for 07c6b9b - Browse repository at this point
Copy the full SHA 07c6b9bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e0c0b9 - Browse repository at this point
Copy the full SHA 5e0c0b9View commit details -
Reset function context when ending a function in IRBuilder
IRBuilder contains a pointer to the current function that is used to create scratch locals, look up the operand types for returns, etc. This pointer is nullable because IRBuilder can also be used in non-function contexts such as global initializers. Visiting the start of a function sets the function pointer, and after this change visiting the end of a function resets the pointer to null. This avoids potential problems where code outside a function would be able to incorrectly use scratch locals and returns if the IRBuilder had previously been used to build a function. This change requires some adjustments to Outlining, which visits code out of order, so ends up visiting code from inside a function after visiting the end of the function. To support this use case, add a `setFunction` method to IRBuilder that lets the user explicitly control its function context. Also remove the optional function pointer parameter to the IRBuilder constructor since it is less flexible and not used.
Configuration menu - View commit details
-
Copy full SHA for 21ef873 - Browse repository at this point
Copy the full SHA 21ef873View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54134fd - Browse repository at this point
Copy the full SHA 54134fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for fdeb5e4 - Browse repository at this point
Copy the full SHA fdeb5e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab150cd - Browse repository at this point
Copy the full SHA ab150cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e14525 - Browse repository at this point
Copy the full SHA 7e14525View commit details -
Configuration menu - View commit details
-
Copy full SHA for fa07c51 - Browse repository at this point
Copy the full SHA fa07c51View commit details -
Configuration menu - View commit details
-
Copy full SHA for cdfe642 - Browse repository at this point
Copy the full SHA cdfe642View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.