feat(phi): Phase 69-2 Remove inspector argument from merge_exit_with_classification

Remove LocalScopeInspectorBox parameter from merge_exit_with_classification:
- Inspector is now constructed internally from exit_snapshots and header_vals
- Simplifies call sites (loopform_builder.rs, json_v0_bridge/loop_.rs)
- Removes 35+ lines of external inspector setup code
- Tests adjusted to match new signature (3 tests PASS)

This is a step toward Phase 69-3 (complete Trio deletion) where
LocalScopeInspectorBox will be fully removed.

Technical changes:
- loop_snapshot_merge.rs: Build inspector from exit_snapshots internally
- loopform_builder.rs: Remove inspector argument from build_exit_phis
- json_v0_bridge/loop_.rs: Remove inspector creation and argument

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-11-30 09:17:10 +09:00
parent 58c5d8c9bc
commit 3387d9c1dc
3 changed files with 26 additions and 68 deletions

View File

@ -416,15 +416,8 @@ pub(super) fn lower_loop_stmt(
)?;
// 8) exit PHIheader fallthrough + break スナップショット)
// Option C: Create inspector (build_exit_phis will populate it)
use crate::mir::phi_core::local_scope_inspector::LocalScopeInspectorBox;
let mut inspector = LocalScopeInspectorBox::new();
// build_exit_phis() now handles all inspector setup internally:
// - Records pinned/carrier definitions in header
// - Records filtered exit snapshots
// - Records header snapshot if it's an exit predecessor
loopform.build_exit_phis(&mut ops, exit_bb, cend, &exit_snaps, &mut inspector)?;
// Phase 69-2: inspector 引数削除merge_exit_with_classification 内部で構築)
loopform.build_exit_phis(&mut ops, exit_bb, cend, &exit_snaps)?;
Ok(exit_bb)
}