refactor(mir): Phase 139-P3-B - RoutingDecision を enum 対応 + レガシー削除
- RoutingDecision の missing_caps を Vec<CapabilityTag> に変更(型安全化) - error_tags は to_tag() メソッドで自動生成 - 全 callsite を enum variant に修正 - capability_tags モジュール(文字列定数群)を完全削除 - 全テスト PASS(型安全性向上を確認) - フォーマット適用
This commit is contained in:
@ -201,7 +201,8 @@ pub fn emit_mir_json_for_harness(
|
||||
.map(|(b, v)| json!([v.as_u32(), b.as_u32()]))
|
||||
.collect();
|
||||
// Phase 131-11-F: Add dst_type hint from metadata for all PHI instructions
|
||||
let mut phi_inst = json!({"op":"phi","dst": dst.as_u32(), "incoming": incoming});
|
||||
let mut phi_inst =
|
||||
json!({"op":"phi","dst": dst.as_u32(), "incoming": incoming});
|
||||
if let Some(dst_type) = f.metadata.value_types.get(dst) {
|
||||
let type_json = match dst_type {
|
||||
MirType::Integer => json!("i64"),
|
||||
@ -227,7 +228,9 @@ pub fn emit_mir_json_for_harness(
|
||||
continue;
|
||||
}
|
||||
I::Copy { dst, src } => {
|
||||
insts.push(json!({"op":"copy","dst": dst.as_u32(), "src": src.as_u32()}));
|
||||
insts.push(
|
||||
json!({"op":"copy","dst": dst.as_u32(), "src": src.as_u32()}),
|
||||
);
|
||||
}
|
||||
I::UnaryOp { dst, op, operand } => {
|
||||
let kind = match op {
|
||||
@ -422,8 +425,7 @@ pub fn emit_mir_json_for_harness(
|
||||
obj["dst_type"] = t;
|
||||
}
|
||||
insts.push(obj);
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {
|
||||
}
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {}
|
||||
}
|
||||
_ => {
|
||||
// Other callee types: emit generic call
|
||||
@ -496,8 +498,7 @@ pub fn emit_mir_json_for_harness(
|
||||
obj["dst_type"] = t;
|
||||
}
|
||||
insts.push(obj);
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {
|
||||
}
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {}
|
||||
}
|
||||
I::NewBox {
|
||||
dst,
|
||||
@ -622,7 +623,8 @@ pub fn emit_mir_json_for_harness_bin(
|
||||
.map(|(b, v)| json!([v.as_u32(), b.as_u32()]))
|
||||
.collect();
|
||||
// Phase 131-11-F: Add dst_type hint from metadata for all PHI instructions
|
||||
let mut phi_inst = json!({"op":"phi","dst": dst.as_u32(), "incoming": incoming});
|
||||
let mut phi_inst =
|
||||
json!({"op":"phi","dst": dst.as_u32(), "incoming": incoming});
|
||||
if let Some(dst_type) = f.metadata.value_types.get(dst) {
|
||||
let type_json = match dst_type {
|
||||
MirType::Integer => json!("i64"),
|
||||
@ -648,34 +650,34 @@ pub fn emit_mir_json_for_harness_bin(
|
||||
continue;
|
||||
}
|
||||
I::Copy { dst, src } => {
|
||||
insts.push(json!({"op":"copy","dst": dst.as_u32(), "src": src.as_u32()}));
|
||||
insts.push(
|
||||
json!({"op":"copy","dst": dst.as_u32(), "src": src.as_u32()}),
|
||||
);
|
||||
}
|
||||
I::Const { dst, value } => {
|
||||
match value {
|
||||
crate::mir::ConstValue::Integer(i) => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "i64", "value": i}}));
|
||||
}
|
||||
crate::mir::ConstValue::Float(fv) => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "f64", "value": fv}}));
|
||||
}
|
||||
crate::mir::ConstValue::Bool(b) => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "i64", "value": if *b {1} else {0}}}));
|
||||
}
|
||||
crate::mir::ConstValue::String(s) => {
|
||||
insts.push(json!({
|
||||
"op":"const",
|
||||
"dst": dst.as_u32(),
|
||||
"value": {
|
||||
"type": {"kind":"handle","box_type":"StringBox"},
|
||||
"value": s
|
||||
}
|
||||
}));
|
||||
}
|
||||
crate::mir::ConstValue::Null | crate::mir::ConstValue::Void => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "void", "value": 0}}));
|
||||
}
|
||||
I::Const { dst, value } => match value {
|
||||
crate::mir::ConstValue::Integer(i) => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "i64", "value": i}}));
|
||||
}
|
||||
}
|
||||
crate::mir::ConstValue::Float(fv) => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "f64", "value": fv}}));
|
||||
}
|
||||
crate::mir::ConstValue::Bool(b) => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "i64", "value": if *b {1} else {0}}}));
|
||||
}
|
||||
crate::mir::ConstValue::String(s) => {
|
||||
insts.push(json!({
|
||||
"op":"const",
|
||||
"dst": dst.as_u32(),
|
||||
"value": {
|
||||
"type": {"kind":"handle","box_type":"StringBox"},
|
||||
"value": s
|
||||
}
|
||||
}));
|
||||
}
|
||||
crate::mir::ConstValue::Null | crate::mir::ConstValue::Void => {
|
||||
insts.push(json!({"op":"const","dst": dst.as_u32(), "value": {"type": "void", "value": 0}}));
|
||||
}
|
||||
},
|
||||
I::BinOp { dst, op, lhs, rhs } => {
|
||||
let op_s = match op {
|
||||
B::Add => "+",
|
||||
@ -794,8 +796,7 @@ pub fn emit_mir_json_for_harness_bin(
|
||||
obj["dst_type"] = t;
|
||||
}
|
||||
insts.push(obj);
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {
|
||||
}
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {}
|
||||
}
|
||||
_ => {
|
||||
// Other callee types: emit generic call
|
||||
@ -829,8 +830,7 @@ pub fn emit_mir_json_for_harness_bin(
|
||||
}
|
||||
}
|
||||
insts.push(obj);
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {
|
||||
}
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {}
|
||||
}
|
||||
I::BoxCall {
|
||||
dst,
|
||||
@ -860,8 +860,7 @@ pub fn emit_mir_json_for_harness_bin(
|
||||
obj["dst_type"] = t;
|
||||
}
|
||||
insts.push(obj);
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {
|
||||
}
|
||||
if let Some(d) = dst.map(|v| v.as_u32()) {}
|
||||
}
|
||||
I::NewBox {
|
||||
dst,
|
||||
|
||||
Reference in New Issue
Block a user