🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
use super::ValueId;
|
|
|
|
|
use crate::ast::ASTNode;
|
|
|
|
|
|
|
|
|
|
impl super::MirBuilder {
|
|
|
|
|
// Indirect call: (callee)(args...)
|
|
|
|
|
pub(super) fn build_indirect_call_expression(
|
|
|
|
|
&mut self,
|
|
|
|
|
callee: ASTNode,
|
|
|
|
|
arguments: Vec<ASTNode>,
|
|
|
|
|
) -> Result<ValueId, String> {
|
|
|
|
|
let callee_id = self.build_expression_impl(callee)?;
|
|
|
|
|
let mut arg_ids: Vec<ValueId> = Vec::new();
|
2025-09-17 07:43:07 +09:00
|
|
|
for a in arguments {
|
|
|
|
|
arg_ids.push(self.build_expression_impl(a)?);
|
|
|
|
|
}
|
2025-09-24 01:05:44 +09:00
|
|
|
|
|
|
|
|
// Phase 3.1: Use unified call with CallTarget::Value for indirect calls
|
2025-09-28 12:19:49 +09:00
|
|
|
let use_unified = super::calls::call_unified::is_unified_call_enabled();
|
2025-09-24 01:05:44 +09:00
|
|
|
|
|
|
|
|
if use_unified {
|
|
|
|
|
// New unified path - use emit_unified_call with Value target
|
2025-11-17 00:48:18 +09:00
|
|
|
let dst = self.next_value_id();
|
2025-09-24 01:05:44 +09:00
|
|
|
self.emit_unified_call(
|
|
|
|
|
Some(dst),
|
|
|
|
|
super::builder_calls::CallTarget::Value(callee_id),
|
|
|
|
|
arg_ids,
|
|
|
|
|
)?;
|
|
|
|
|
Ok(dst)
|
|
|
|
|
} else {
|
2025-11-13 16:40:58 +09:00
|
|
|
// Unified-off path: still encode callee as Value to avoid by-name resolution
|
2025-11-17 00:48:18 +09:00
|
|
|
let dst = self.next_value_id();
|
2025-09-24 01:05:44 +09:00
|
|
|
self.emit_instruction(super::MirInstruction::Call {
|
|
|
|
|
dst: Some(dst),
|
|
|
|
|
func: callee_id,
|
2025-11-21 06:25:17 +09:00
|
|
|
callee: Some(crate::mir::definitions::call_unified::Callee::Value(
|
|
|
|
|
callee_id,
|
|
|
|
|
)),
|
2025-09-24 01:05:44 +09:00
|
|
|
args: arg_ids,
|
|
|
|
|
effects: super::EffectMask::PURE,
|
|
|
|
|
})?;
|
|
|
|
|
Ok(dst)
|
|
|
|
|
}
|
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:34:15 +09:00
|
|
|
}
|
|
|
|
|
}
|