-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
expression: avoid unnecessary warnings/errors when folding constants in control expr (#19675) #19910
expression: avoid unnecessary warnings/errors when folding constants in control expr (#19675) #19910
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
/rebuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
Sorry @fzhedu, you don't have permission to trigger auto merge event on this branch. |
/merge |
/run-all-tests |
cherry-pick #19675 to release-4.0
What problem does this PR solve?
Issue Number: close #17725
following #19367, avoid unnecessary warnings/errors when folding constants in control expr.
Problem Summary:
What is changed and how it works?
Proposal: xxx
What's Changed:
the scalar
if
is wrong, to be corrected here,add
tryFoldCounter
to try fold constrants but not throw warnings/erros.correct the special handler for control expressions.
How it Works:
each branch of control expressions fold contrants whenever possible, but not throw uncessary warnings/errors. When folding the control expressions, it run the normal branches and return normally like evaluating scalar expressions. If a branch is not const, it will stop folding constrants.
Related changes
Check List
Tests
Release note