refactor: Extract pattern lowerers from control_flow.rs (Phase 2)

- Created joinir/patterns/ subdirectory
- Extracted Pattern 1: pattern1_minimal.rs (Simple While)
- Extracted Pattern 2: pattern2_with_break.rs (Loop with Break)
- Extracted Pattern 3: pattern3_with_if_phi.rs (Loop with If-Else PHI)
- Created patterns/mod.rs dispatcher
- Removed ~410 lines from main control_flow.rs
- Zero breaking changes, all tests pass
This commit is contained in:
nyash-codex
2025-12-05 20:45:23 +09:00
parent 41de2d20e9
commit 282d2ef450
6 changed files with 455 additions and 413 deletions

View File

@ -0,0 +1,10 @@
//! Pattern lowerers for different loop constructs
//!
//! Phase 2: Extracted from control_flow.rs
//! - Pattern 1: Simple While Loop (pattern1_minimal.rs)
//! - Pattern 2: Loop with Conditional Break (pattern2_with_break.rs)
//! - Pattern 3: Loop with If-Else PHI (pattern3_with_if_phi.rs)
pub(in crate::mir::builder) mod pattern1_minimal;
pub(in crate::mir::builder) mod pattern2_with_break;
pub(in crate::mir::builder) mod pattern3_with_if_phi;