-
Notifications
You must be signed in to change notification settings - Fork 396
Normalize if/else blocks #10270
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
Open
niloc132
wants to merge
75
commits into
gwtproject:main
Choose a base branch
from
niloc132:10239-if-child-blocks-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Normalize if/else blocks #10270
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
5b68b92
quick wip
niloc132 262b13b
Vaguely functional implementation, except for switches
niloc132 95174ed
A little more clean up, all samples build cleanly
niloc132 6b603e7
Don't try to move {}s, better java gen, fix a js bug
niloc132 2938c74
Checkpoint, user tests pass but compiler fails
niloc132 de87228
More consistent output, still have a small size regression (inlining?)
niloc132 3f3c0f2
Try to restore ExpandBlocks, more problems found
niloc132 4a64133
Nearly correct impl of ExpandBlocks
niloc132 2786f4b
Cleanup dead code
niloc132 fdc0352
Remove the 'expand blocks' experiment
niloc132 bd9638b
break long line
niloc132 d3b0503
Update tests to drop extra braces when unnecessary
niloc132 b4cb9d5
Defensively add {}s to JS ifs
niloc132 c0fa094
Improved version of adding necessary braces
niloc132 48e32a9
checkstyle
niloc132 446049a
Drop Java 11 support
niloc132 8a8cf18
Compute total size of samples correctly
zbynek cb19126
Include deferred size in compilation report
zbynek 0beeb84
Merge remote-tracking branch 'pr/10263' into 10239-if-child-blocks-test
niloc132 021fed8
Merge branch 'main' into 10239-if-child-blocks-test
niloc132 459f301
fix java ast dump to avoid dangling else
niloc132 6f26726
do/for/while support
niloc132 cb302b2
if's else can never be null, fixed other tests
niloc132 9b2de0d
Raise Java language level to 17, update errorprone
niloc132 1458a5d
temporarily use tools branch
niloc132 6bf7233
new apis to triage
niloc132 52acf3a
Rename missing emul files
niloc132 d2cea9a
Revert "temporarily use tools branch"
niloc132 54e5fd7
Update notes about what versions are required
niloc132 f27bcb7
Hardcode preview methods, support java 26 with an EP workaround
niloc132 67d99e3
Bump asm to support Java 27
niloc132 c70fb47
Temp tools branch
niloc132 470e637
Another errorprone bug
niloc132 14f91f1
Remove Java 26 again, seems to break DOMSuite
niloc132 b8e9479
quick wip
niloc132 790478d
Vaguely functional implementation, except for switches
niloc132 207a283
A little more clean up, all samples build cleanly
niloc132 ccdc74d
Don't try to move {}s, better java gen, fix a js bug
niloc132 073dd28
Checkpoint, user tests pass but compiler fails
niloc132 206198d
More consistent output, still have a small size regression (inlining?)
niloc132 279130a
Try to restore ExpandBlocks, more problems found
niloc132 c93bc4c
Nearly correct impl of ExpandBlocks
niloc132 382b730
Cleanup dead code
niloc132 4bee28a
Remove the 'expand blocks' experiment
niloc132 118bfbf
break long line
niloc132 96231ff
Update tests to drop extra braces when unnecessary
niloc132 38fb2bd
Defensively add {}s to JS ifs
niloc132 d53e77d
Improved version of adding necessary braces
niloc132 362537d
checkstyle
niloc132 ac18a98
fix java ast dump to avoid dangling else
niloc132 ac44bd1
do/for/while support
niloc132 42baabe
if's else can never be null, fixed other tests
niloc132 19a0aa5
Updated draft, trying to unify logic, avoid copy/paste
niloc132 3c6fa13
Also remove continue;s, add a simple test
niloc132 fafdf66
Support 17 for dev core too
niloc132 62b4cd4
checkstyle, revert unneeded java 17 changes
niloc132 d0f4b4c
Merge branch 'main' into min-java17
niloc132 8d5288e
Remove java 26 from list for now
niloc132 4cce622
Revert "Temp tools branch"
niloc132 9dd8107
Merge branch 'min-java17' into 10248-remove-pointless-returns
niloc132 4e476b9
Merge branch 'main' into 10248-remove-pointless-returns
niloc132 ad0946e
Revert do->while rewrite, unrelated
niloc132 955e3d5
Remove a comment that can't be handled in the java pass anyway
niloc132 ae4df09
Add more cases, exclude switch-expr, and write out more tests
niloc132 d82c4f4
More test
niloc132 64594ec
Merge branch 'main' into 10248-remove-pointless-returns
niloc132 a0b883c
More test, fix a bug
niloc132 ec0109f
checkstyle
niloc132 d549e2e
Support missing finally blocks
niloc132 378fb80
Merge branch '10248-remove-pointless-returns' into 10239-if-child-blo…
niloc132 6283b23
pick up changes from 10248, minus the point of that PR
niloc132 c141eec
Remove accidentally added files
niloc132 9dcd9bc
qsuash
niloc132 7d3b621
Review feedback, style
niloc132 768923f
Rigorously check for dangling else
niloc132 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ | |
| */ | ||
| public class JForStatement extends JStatement { | ||
|
|
||
| private JStatement body; | ||
| private JBlock body; | ||
| private List<JStatement> initializers; | ||
| private JExpression condition; | ||
| private JExpression increments; | ||
|
|
@@ -40,13 +40,13 @@ | |
| this.initializers = Lists.newArrayList(initializers); | ||
| this.condition = condition; | ||
| this.increments = increments; | ||
| this.body = body; | ||
| this.body = JBlock.ensureBlock(info, body); | ||
| } | ||
|
|
||
| /** | ||
| * Returns the {@code for} statement body. | ||
| */ | ||
| public JStatement getBody() { | ||
| public JBlock getBody() { | ||
| return body; | ||
| } | ||
|
|
||
|
|
@@ -81,9 +81,7 @@ | |
| if (increments != null) { | ||
| increments = visitor.accept(increments); | ||
| } | ||
| if (body != null) { | ||
| body = visitor.accept(body, true); | ||
| } | ||
| body = JBlock.ensureBlock(getSourceInfo(), visitor.accept(body, false));//TODO no tests fail without this change... | ||
|
Check warning on line 84 in dev/core/src/com/google/gwt/dev/jjs/ast/JForStatement.java
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove TODO after verifying with a test. |
||
| } | ||
| visitor.endVisit(this, ctx); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.