feat(joinir): Phase 202-A Pattern 1 uses JoinValueSpace
Migrated Pattern 1 (Simple While) to use JoinValueSpace for unified ValueId allocation, following the same pattern as Pattern 2 (Phase 201). Changes: - simple_while_minimal.rs: Added join_value_space parameter, replaced value_counter with join_value_space.alloc_local() - pattern1_minimal.rs: Create JoinValueSpace before calling lowerer - loop_view_builder.rs: Create JoinValueSpace in try_pattern1() Pattern 1 uses Local region (1000+) only, since it doesn't need ConditionEnv (no Param region allocation required). Tested: - cargo build --release --lib: Success (0 errors, 4 warnings) - cargo test --release --lib pattern: 119 passed - E2E test apps/tests/loop_min_while.hako: Outputs "0 1 2" correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -118,6 +118,8 @@ impl LoopViewBuilder {
|
||||
/// - 関数名に "main" が含まれる
|
||||
/// - Pinned vars がない
|
||||
/// - Carriers が1つ以上
|
||||
///
|
||||
/// # Phase 202-A: JoinValueSpace Integration
|
||||
fn try_pattern1(&self, scope: &LoopScopeShape, name: &str) -> Option<JoinModule> {
|
||||
if !name.contains("main") {
|
||||
return None;
|
||||
@ -128,7 +130,14 @@ impl LoopViewBuilder {
|
||||
eprintln!("[LoopViewBuilder] Trying Pattern 1 lowering for {:?}", name);
|
||||
}
|
||||
|
||||
if let Some(result) = super::simple_while_minimal::lower_simple_while_minimal(scope.clone()) {
|
||||
// Phase 202-A: Create JoinValueSpace for Pattern 1
|
||||
use super::join_value_space::JoinValueSpace;
|
||||
let mut join_value_space = JoinValueSpace::new();
|
||||
|
||||
if let Some(result) = super::simple_while_minimal::lower_simple_while_minimal(
|
||||
scope.clone(),
|
||||
&mut join_value_space,
|
||||
) {
|
||||
if self.debug {
|
||||
eprintln!("[LoopViewBuilder] Pattern 1 lowering succeeded for {:?}", name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user