Skip to content
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

C++: Generate int-to-bool conversion instructions in C code #18017

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Nov 18, 2024

This fixes the inconsistencies highlighted in #18013 by generating the IR for int-to-bool conversions as part of IR generation. There are three places where we need to do something (based on grep'ing for Opcode::LogicalNot and Opcode::ConditionalBranch):

  • When translating branching points
  • When translating NotExpr
  • When translating ?: with two operands

Commit-by-commit review recommended.

@github-actions github-actions bot added the C++ label Nov 18, 2024
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Nov 18, 2024
@MathiasVP MathiasVP force-pushed the generate-int-to-bool-conversion-instructions branch from f47fd94 to 7e13550 Compare November 19, 2024 11:21
@MathiasVP MathiasVP force-pushed the generate-int-to-bool-conversion-instructions branch from 7e13550 to 92ac5f6 Compare November 20, 2024 13:48
@MathiasVP MathiasVP force-pushed the generate-int-to-bool-conversion-instructions branch from 92ac5f6 to 2dc34c7 Compare November 20, 2024 13:58
@MathiasVP MathiasVP changed the title C++: Generate int-to-bool conversion instruction in C code C++: Generate int-to-bool conversion instructions in C code Nov 20, 2024
@MathiasVP MathiasVP force-pushed the generate-int-to-bool-conversion-instructions branch from 2dc34c7 to c9b478b Compare November 20, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant