Skip to content

Move statement family out-of-line into MLIRGenStatements.cpp (§1)#221

Merged
ASDAlexander77 merged 1 commit into
mainfrom
refactor/split-statements
Jul 13, 2026
Merged

Move statement family out-of-line into MLIRGenStatements.cpp (§1)#221
ASDAlexander77 merged 1 commit into
mainfrom
refactor/split-statements

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

Continues the §1 TU split (docs/MLIRGen-refactoring-review.md), same pattern as #217#220.

21 statement-level methods move from MLIRGenImpl.h into a new MLIRGenStatements.cpp TU, with declarations left in the header: mlirGenBody, clearState, the NodeArray<Statement>/ts::Block/Statement dispatchers, and the ExpressionStatement, VariableStatement, ReturnStatement, IfStatement, DoStatement, WhileStatement, ForStatement, ForInStatement, ForOfStatement, LabeledStatement, DebuggerStatement, ContinueStatement, BreakStatement, SwitchStatement, ThrowStatement, TryStatement generators.

  • 942 lines out of the header (19,909 → 18,967)
  • The one default argument (ts::Block dispatcher's skipStatements = 0) stays on the declaration and is stripped from the out-of-line definition
  • CMake entry added alphabetically

Remaining §1 families after this: expressions, functions, classes.

Test plan

  • Clean rebuild with the new TU layout
  • 683/683 ctest tests passed (148 s) — full AOT + JIT + unittests

🤖 Generated with Claude Code

- Added methods for generating MLIR code for various statement types including blocks, expressions, and control flow statements (if, while, for, etc.).
- Introduced handling for return, break, continue, and throw statements.
- Implemented support for labeled statements and switch cases.
- Enhanced error handling and state management during code generation.
- Integrated debug information generation for MLIR.
- Established a clear structure for processing different statement kinds and their corresponding MLIR operations.
@ASDAlexander77 ASDAlexander77 merged commit eadaa6b into main Jul 13, 2026
2 checks passed
@ASDAlexander77 ASDAlexander77 deleted the refactor/split-statements branch July 13, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant