Files
hakorune/crates
tomoaki ce2baa0d47 feat(llvm): Phase 285 P3 - KeepAlive/ReleaseStrong LLVM implementation
Phase 285 P3: LLVM One-Pass (VM/LLVM一気通貫の最小ゲート)

## 実装内容

### 1. LLVM Backend (Python)
- src/llvm_py/instructions/lifecycle.py: NEW
  - lower_keepalive(): no-op (DCE/liveness only)
  - lower_release_strong(): ny_release_strong() 呼び出し
- src/llvm_py/builders/instruction_lower.py:
  - KeepAlive/ReleaseStrong ディスパッチエントリ追加

### 2. Runtime (Rust)
- crates/nyash_kernel/src/lib.rs:
  - ny_release_strong(handle: i64): handles::drop() 呼び出し
  - Phase 287対応(変数上書きセマンティクス)

### 3. MIR JSON Serialization
- src/runner/mir_json_emit.rs:
  - KeepAlive/ReleaseStrong JSON emit 追加(両関数)
  - {"op":"keepalive","values":[...]}
  - {"op":"release_strong","values":[...]}

## テスト結果

 **phase285_p2_weak_upgrade_fail_llvm**: PASS (exit 1, weak_to_strong null)
⏸️ **phase285_p2_weak_upgrade_success_llvm**: SKIP (--version に features 表示なし)
⏸️ **phase284_p2_return_in_loop_llvm**: SKIP (同上)

## SKIP理由(--version feature表示問題)

テストスクリプトが `--version | grep "features.*llvm"` で環境チェックするが、
現在の --version は "nyash 1.0" のみ出力。LLVM feature有効でも SKIP される。

**対応方針**: Phase 285 P3 目的(KeepAlive/ReleaseStrong LLVM実装)達成。
--version feature表示は Phase 286以降で対応予定。

## 検証

- cargo build --release --features llvm: OK
- weak_upgrade_fail_llvm: PASS (VM/LLVM parity確認)
- quick gate: 154/154 PASS (退行なし)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 14:34:05 +09:00
..