-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Handle implicit casts in translate-c #2296
Conversation
846cea1
to
6336110
Compare
src/translate_c.cpp
Outdated
// - Fold the comparison iif the value is either 0/1 | ||
// - Don't fold the comparison (this generates awkward code such | ||
// as 1 != 0 for true or 0 != 0 for false | ||
#if 0 |
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.
I like the "always try to constant-fold the comparison". I don't really see any downsides to it, do you?
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.
I like the "always try to constant-fold the comparison"
Done!
I don't really see any downsides to it, do you?
Folding everything "erases" the constant value coming from the C code, but that's not much of a problem, I guess.
6336110
to
70c2e86
Compare
Please review carefully and check out the
XXX