🎉 Conservative PHI Box理論による完全SSA構築 **Phase 7-B: Conservative PHI実装** - 片方branchのみ定義変数に対応(emit_void使用) - 全変数にPHI生成(Conservative Box理論) - Stage-1 resolver全テスト緑化(3/3 PASS) **Phase 25.1f: ControlForm観測レイヤー** - LoopShape/IfShape/ControlForm構造定義 - Loop/If統一インターフェース実装 - debug_dump/debug_validate機能追加 - NYASH_CONTROL_FORM_TRACE環境変数対応 **主な変更**: - src/mir/builder/phi.rs: Conservative PHI実装 - src/mir/control_form.rs: ControlForm構造(NEW) - src/mir/loop_builder.rs: LoopForm v2デフォルト化 **テスト結果**: ✅ mir_stage1_using_resolver_min_fragment_verifies ✅ mir_stage1_using_resolver_full_collect_entries_verifies ✅ mir_parserbox_parse_program2_harness_parses_minimal_source 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: ChatGPT <chatgpt@openai.com>
45 lines
1.9 KiB
Rust
45 lines
1.9 KiB
Rust
//! 🎯 箱理論 Phase 2完了: builder_calls.rs → calls/* 完全移行
|
||
//!
|
||
//! **削減実績**:
|
||
//! - Phase 1: 982行 → 766行(216行削減、22%削減)
|
||
//! - Phase 2: 766行 → 49行(717行削減、94%削減)
|
||
//! - **合計削減**: 933行(95%削減達成!)
|
||
//!
|
||
//! **移行先**:
|
||
//! - `calls/emit.rs`: Call命令発行(emit_unified_call, emit_legacy_call等)
|
||
//! - `calls/build.rs`: Call構築(build_function_call, build_method_call等)
|
||
//! - `calls/lowering.rs`: 関数lowering(Phase 1で既に移行済み)
|
||
//! - `calls/utils.rs`: ユーティリティ(Phase 1で既に移行済み)
|
||
//!
|
||
//! **箱理論の原則**:
|
||
//! 1. ✅ 責務ごとに箱に分離: emit(発行)、build(構築)を明確に分離
|
||
//! 2. ✅ 境界を明確に: 各モジュールで公開インターフェース明確化
|
||
//! 3. ✅ いつでも戻せる: re-exportで既存API完全保持
|
||
//! 4. ✅ 巨大関数は分割: 100行超える関数を30-50行目標で分割
|
||
|
||
// Import from new modules (refactored with Box Theory)
|
||
pub use super::calls::call_target::CallTarget;
|
||
|
||
// ========================================
|
||
// Re-exports for backward compatibility
|
||
// ========================================
|
||
|
||
impl super::MirBuilder {
|
||
// 🎯 Phase 2移行完了マーカー: すべての実装は calls/* に移行済み
|
||
|
||
/// Map a user-facing type name to MIR type
|
||
/// 実装: calls/utils.rs
|
||
pub(super) fn parse_type_name_to_mir(name: &str) -> super::MirType {
|
||
crate::mir::builder::calls::utils::parse_type_name_to_mir(name)
|
||
}
|
||
|
||
/// Extract string literal from AST node if possible
|
||
/// 実装: calls/utils.rs
|
||
pub(super) fn extract_string_literal(node: &crate::ast::ASTNode) -> Option<String> {
|
||
crate::mir::builder::calls::utils::extract_string_literal(node)
|
||
}
|
||
|
||
// Note: All other methods (emit_unified_call, build_function_call, etc.)
|
||
// are automatically available via `pub use super::calls::*;`
|
||
}
|