JoinIR/SSA/Stage-3: sync CURRENT_TASK and dev env

This commit is contained in:
nyash-codex
2025-12-01 11:10:46 +09:00
parent a3d5bacc55
commit 8633224061
52 changed files with 974 additions and 256 deletions

View File

@ -20,6 +20,7 @@ pub mod exit_args_resolver;
pub mod funcscanner_append_defs;
pub mod funcscanner_trim;
pub mod generic_case_a;
pub mod generic_type_resolver; // Phase 66: P3-C ジェネリック型推論箱
pub mod if_dry_runner; // Phase 33-10.0
pub mod if_merge; // Phase 33-7
pub mod if_phi_context; // Phase 61-1
@ -35,7 +36,6 @@ pub mod stageb_body;
pub mod stageb_funcscanner;
pub mod type_hint_policy; // Phase 65.5: 型ヒントポリシー箱化
pub mod type_inference; // Phase 65-2-A
pub mod generic_type_resolver; // Phase 66: P3-C ジェネリック型推論箱
pub mod value_id_ranges;
// Re-export public lowering functions
@ -148,6 +148,8 @@ pub fn try_lower_if_to_joinir(
if !crate::config::env::joinir_if_select_enabled() {
return None;
}
let core_on = crate::config::env::joinir_core_enabled();
let strict_on = crate::config::env::joinir_strict_enabled();
// Phase 33-9.1: Loop専任関数の除外Loop/If責務分離
// Loop lowering対象関数はIf loweringの対象外にすることで、
@ -179,15 +181,21 @@ pub fn try_lower_if_to_joinir(
"Stage1JsonScannerBox.value_start_after_key_pos/2"
);
if !is_allowed {
if debug_level >= 2 {
eprintln!(
"[try_lower_if_to_joinir] skipping non-allowed function: {}",
func.signature.name
);
// Phase 80: Core ON のときは許可リストを「JoinIRをまず試す」対象とみなす。
// Core OFF のときは従来どおり whitelist + env に頼る。
if !is_allowed || !core_on {
// Core OFF かつ許可外なら従来のガードでスキップ
if !is_allowed {
if debug_level >= 2 {
eprintln!(
"[try_lower_if_to_joinir] skipping non-allowed function: {}",
func.signature.name
);
}
return None;
}
return None;
}
let strict_allowed = strict_on && core_on && is_allowed;
if debug_level >= 1 {
eprintln!(
@ -232,6 +240,12 @@ pub fn try_lower_if_to_joinir(
func.signature.name
);
}
if strict_allowed {
panic!(
"[joinir/if] strict mode: pattern not matched for {}",
func.signature.name
);
}
return None;
}
@ -244,6 +258,13 @@ pub fn try_lower_if_to_joinir(
);
}
if result.is_none() && strict_allowed {
panic!(
"[joinir/if] strict mode: lowering failed for {}",
func.signature.name
);
}
result
}