refactor(llvm): Phase 132-P1 follow-up - bind block_end_values and clear predeclared PHIs

This commit is contained in:
nyash-codex
2025-12-15 11:47:58 +09:00
parent e0fb6fecf6
commit a15d1e97e6
3 changed files with 41 additions and 1 deletions

View File

@ -110,3 +110,24 @@ JoinIR merge の契約検証debug buildで **早期に Fail-Fast** する
期待される振る舞い:
- debug build では compile/run 中に panic で即停止(原因と修正案が出る)
- release build の既定挙動は変えない(検証は `debug_assertions` のみ)
---
## 追加: Phase 132-P1LLVM PythonFunctionLowerContext Box
Phase 131132 で顕在化した「関数間の状態漏洩block id / value id の衝突)」を、
tuple-key の小手先ではなく **構造で根治**するために、関数ローカル状態を 1 箱に隔離した。
- 実装: `src/llvm_py/context/function_lower_context.py`
- 統合: `src/llvm_py/builders/function_lower.py`
箱の責務SSOT:
- `block_end_values`snapshot
- `def_blocks`
- `jump_only_blocks`
- `phi_manager`
- resolver cachesi64/ptr/f64/end_i64 など)
狙い:
- 関数単位で state を自動破棄し、cross-function collision を “起こせない構造” にする
- 追加の手動クリアや tuple-key を不要にする