Skip to content

Add support for BreakStmt and ContinueStmt in IRx #242

@m-akhil-reddy

Description

@m-akhil-reddy

Summary

Description:

BreakStmt and ContinueStmt from ASTx are currently not implemented in IRx.

From inspection, loop constructs like WhileStmt and ForRangeLoopStmt already define the necessary basic blocks (condition, body, and exit). However, there is no control flow handling for break and continue statements inside these loops.

To complete loop control flow support, IRx should:

  • Handle BreakStmt by branching to the loop exit block
  • Handle ContinueStmt by branching to the loop condition (or loop header) block

This would align IRx more closely with ASTx node coverage and improve correctness for loop execution.

I’d like to work on implementing this.

Additional Information

No response

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions