refactor(funcscanner): Region+next_i パターン統一 & SSA テスト追加
**FuncScanner .hako 側改善**: - scan_all_boxes を Region + next_i 形式に統一(continue 多発による SSA/PHI 複雑さ削減) - インデント修正(タブ→スペース統一) - デバッグ print 削除 **SSA テスト追加**: - lang/src/compiler/tests/funcscanner_scan_methods_min.hako - src/tests/mir_funcscanner_ssa.rs (scan_methods & fib_min SSA デバッグテスト) **Phase 25.3 ドキュメント**: - docs/development/roadmap/phases/phase-25.3-funcscanner/ 追加 **関連**: Phase 25.3 FuncScanner 箱化準備作業 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -325,6 +325,12 @@ impl super::MirBuilder {
|
||||
|
||||
// Dev stub: provide condition_fn when missing to satisfy predicate calls in JSON lexers
|
||||
// Returns integer 1 (truthy) and accepts one argument (unused).
|
||||
//
|
||||
// NOTE:
|
||||
// - MirFunction::new() はシグネチャの params に応じて
|
||||
// [ValueId(0)..ValueId(param_count-1)] を事前に予約する。
|
||||
// - ここでは追加の next_value_id()/params.push() は行わず、
|
||||
// 予約済みのパラメータ集合をそのまま使う。
|
||||
if module.functions.get("condition_fn").is_none() {
|
||||
let sig = FunctionSignature {
|
||||
name: "condition_fn".to_string(),
|
||||
@ -334,9 +340,6 @@ impl super::MirBuilder {
|
||||
};
|
||||
let entry = BasicBlockId::new(0);
|
||||
let mut f = MirFunction::new(sig, entry);
|
||||
// parameter slot (unused in body)
|
||||
let _param = f.next_value_id();
|
||||
f.params.push(_param);
|
||||
// body: const 1; return it(FunctionEmissionBox を使用)
|
||||
let one = crate::mir::function_emission::emit_const_integer(&mut f, entry, 1);
|
||||
crate::mir::function_emission::emit_return_value(&mut f, entry, one);
|
||||
|
||||
Reference in New Issue
Block a user