fix(llvm): Phase 131-7 - Multi-pass vmap sync 修正(Branch bug 解消)
Phase 131-7: Multi-pass block lowering の vmap sync バグ修正 問題: - Pass A (body instructions) が vmap_cur に値を保存 - Pass C (deferred terminators) が builder.vmap を参照 - → Pass A の値が Pass C に届かない - → Branch condition が 0 に fallback → 無限ループ 修正: - src/llvm_py/builders/block_lower.py (lines 237-248): - PHI-only フィルタを削除 - 全ての値を global vmap に sync 変更ファイル: - src/llvm_py/builders/block_lower.py: vmap sync 修正 - src/llvm_py/instructions/controlflow/branch.py: trace logging 追加 - src/llvm_py/instructions/unop.py: trace logging 追加 - src/llvm_py/llvm_builder.py: debug helpers 追加 - src/llvm_py/phi_wiring/wiring.py: trace logging 追加 - src/runner/modes/common_util/exec.rs: Python stdout 転送 結果: - ✅ Branch bug 修正: ループが正しく終了 - ✅ 出力: 無限ループ → 3回で停止 - ❌ 新 bug 発見: ExternCall が null を受け取る(PHI 値の代わりに) Next: Phase 131-8 (ExternCall argument handling 修正) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -43,6 +43,17 @@ pub fn llvmlite_emit_object(
|
||||
out_path,
|
||||
]);
|
||||
let out = spawn_with_timeout(cmd, timeout_ms).map_err(|e| format!("spawn harness: {}", e))?;
|
||||
// Print Python stdout/stderr for debugging (Phase 131-7)
|
||||
let should_print_debug = std::env::var("NYASH_LLVM_TRACE_PHI").ok().as_deref() == Some("1")
|
||||
|| std::env::var("NYASH_CLI_VERBOSE").ok().as_deref() == Some("1");
|
||||
if should_print_debug {
|
||||
if !out.stdout.is_empty() {
|
||||
eprintln!("[Python stdout]:\n{}", String::from_utf8_lossy(&out.stdout));
|
||||
}
|
||||
if !out.stderr.is_empty() {
|
||||
eprintln!("[Python stderr]:\n{}", String::from_utf8_lossy(&out.stderr));
|
||||
}
|
||||
}
|
||||
if out.timed_out || !out.status_ok {
|
||||
return Err(format!(
|
||||
"llvmlite harness failed (timeout={} code={:?})",
|
||||
|
||||
Reference in New Issue
Block a user