2025-12-05 20:45:23 +09:00
|
|
|
//! 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)
|
2025-12-06 00:10:27 +09:00
|
|
|
//! - Pattern 4: Loop with Continue (pattern4_with_continue.rs) [Phase 194+]
|
2025-12-05 22:11:39 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 194: Table-driven router for pattern dispatch
|
|
|
|
|
//! - Router module provides table-driven pattern matching
|
|
|
|
|
//! - Each pattern exports can_lower() and lower() functions
|
|
|
|
|
//! - See router.rs for how to add new patterns
|
2025-12-06 03:30:03 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 193: AST Feature Extraction Modularization
|
|
|
|
|
//! - ast_feature_extractor.rs: Pure function module for analyzing loop AST
|
|
|
|
|
//! - High reusability for Pattern 5-6 and pattern analysis tools
|
2025-12-06 11:09:03 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 193-4: Exit Binding Builder
|
|
|
|
|
//! - exit_binding.rs: Fully boxified exit binding generation
|
|
|
|
|
//! - Eliminates hardcoded variable names and ValueId assumptions
|
|
|
|
|
//! - Supports both single and multi-carrier loop patterns
|
2025-12-07 21:02:20 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 33-22: Common Pattern Infrastructure
|
|
|
|
|
//! - common_init.rs: CommonPatternInitializer for unified initialization
|
|
|
|
|
//! - conversion_pipeline.rs: JoinIRConversionPipeline for unified conversion flow
|
2025-12-08 03:39:46 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 171-172: Refactoring Infrastructure
|
|
|
|
|
//! - loop_scope_shape_builder.rs: Unified LoopScopeShape initialization (Issue 4)
|
2025-12-08 03:48:18 +09:00
|
|
|
//! - condition_env_builder.rs: Unified ConditionEnv construction (Issue 5)
|
2025-12-08 04:00:44 +09:00
|
|
|
//!
|
|
|
|
|
//! Phase 33-23: Pattern-Specific Analyzers (Stage 2)
|
|
|
|
|
//! - pattern4_carrier_analyzer.rs: Pattern 4 carrier analysis and normalization (Issue 2)
|
2025-12-05 20:45:23 +09:00
|
|
|
|
2025-12-06 03:30:03 +09:00
|
|
|
pub(in crate::mir::builder) mod ast_feature_extractor;
|
2025-12-07 21:02:20 +09:00
|
|
|
pub(in crate::mir::builder) mod common_init;
|
2025-12-08 03:48:18 +09:00
|
|
|
pub(in crate::mir::builder) mod condition_env_builder;
|
2025-12-07 21:02:20 +09:00
|
|
|
pub(in crate::mir::builder) mod conversion_pipeline;
|
2025-12-06 11:09:03 +09:00
|
|
|
pub(in crate::mir::builder) mod exit_binding;
|
2025-12-08 03:39:46 +09:00
|
|
|
pub(in crate::mir::builder) mod loop_scope_shape_builder;
|
2025-12-05 20:45:23 +09:00
|
|
|
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;
|
2025-12-08 04:00:44 +09:00
|
|
|
pub(in crate::mir::builder) mod pattern4_carrier_analyzer;
|
2025-12-06 00:10:27 +09:00
|
|
|
pub(in crate::mir::builder) mod pattern4_with_continue;
|
2025-12-05 22:11:39 +09:00
|
|
|
pub(in crate::mir::builder) mod router;
|
|
|
|
|
|
|
|
|
|
// Re-export router for convenience
|
|
|
|
|
pub(in crate::mir::builder) use router::{route_loop_pattern, LoopPatternContext};
|