feat(plan): Phase 273 P2 Step 0 - CoreEffectPlan side effect support
Prepare CoreEffectPlan::MethodCall for Pattern7 (split) support: - dst: ValueId → Option<ValueId> (for void methods like push) - effects: EffectMask field added (PURE+Io vs MUT) Changes: - plan/mod.rs: MethodCall struct updated - plan/lowerer.rs: emit_effect() uses dst/effects from plan - plan/normalizer.rs: MethodCall with explicit effects - plan/verifier.rs: Handle Option<ValueId> dst Test: phase258_p0_index_of_string_vm PASS (exit=6) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
use super::{CoreEffectPlan, CoreLoopPlan, CorePlan};
|
||||
use crate::mir::builder::control_flow::joinir::patterns::router::LoopPatternContext;
|
||||
use crate::mir::builder::MirBuilder;
|
||||
use crate::mir::{Effect, EffectMask, MirInstruction, ValueId};
|
||||
use crate::mir::{MirInstruction, ValueId};
|
||||
|
||||
/// Phase 273 P1: PlanLowerer - CorePlan → MIR 生成 (SSOT)
|
||||
pub(in crate::mir::builder) struct PlanLowerer;
|
||||
@ -218,14 +218,15 @@ impl PlanLowerer {
|
||||
value: value.clone(),
|
||||
})?;
|
||||
}
|
||||
CoreEffectPlan::MethodCall { dst, object, method, args } => {
|
||||
CoreEffectPlan::MethodCall { dst, object, method, args, effects } => {
|
||||
// P2: dst and effects are now specified by Normalizer
|
||||
builder.emit_instruction(MirInstruction::BoxCall {
|
||||
dst: Some(*dst),
|
||||
dst: *dst,
|
||||
box_val: *object,
|
||||
method: method.clone(),
|
||||
method_id: None,
|
||||
args: args.clone(),
|
||||
effects: EffectMask::PURE.add(Effect::Io),
|
||||
effects: *effects,
|
||||
})?;
|
||||
}
|
||||
CoreEffectPlan::BinOp { dst, lhs, op, rhs } => {
|
||||
|
||||
Reference in New Issue
Block a user