docs: expand LLVM backend ENV vars documentation

Phase 22.x: add NYASH_LLVM_NATIVE_TRACE and expand NYASH_LLVM_BACKEND
- Add auto mode with llvmlite→crate fallback priority
- Add NYASH_LLVM_NATIVE_TRACE=1 for native IR stderr dump
- Clarify each backend option (llvmlite/crate/native)
This commit is contained in:
nyash-codex
2025-11-09 23:44:16 +09:00
parent f6c5dc9e43
commit b0898fcd7b

View File

@ -89,14 +89,20 @@ Call/route unified trace (optional)
- NYASH_DISABLE_NY_COMPILER=1, HAKO_DISABLE_NY_COMPILER=1
LLVM backend selector (builder wrapper)
- NYASH_LLVM_BACKEND=llvmlite|crate|native
- NYASH_LLVM_BACKEND=auto|llvmlite|crate|native
- Selects the backend used by `tools/ny_mir_builder.sh` for `--emit obj|exe`.
- Default: `llvmlite` (Python harness `tools/llvmlite_harness.py`).
- Default: `auto` (auto-detection: llvmlite優先、fallback to crate if llvmlite unavailable).
- `llvmlite`: Python harness `tools/llvmlite_harness.py` (requires llvmlite installed).
- `crate`: uses `./target/release/ny-llvmc` (build with `cargo build -p nyash-llvm-compiler --release`).
- `native`: reserved for future Hako-native builder.
- Linking extras for `--emit exe`: pass via `HAKO_AOT_LDFLAGS` (e.g., `-static`), `ny-llvmc` consumes `--libs`.
- Note: crate 経路では ny_main の戻り値i64がプロセスの終了コードに反映されますrc mapping
- NYASH_LLVM_NATIVE_TRACE=0|1
- When 1, dumps the native IR to stderr for debugging.
- Used with `native` backend to inspect generated LLVM IR before optimization.
- Default OFF; only active when NYASH_LLVM_BACKEND=native is set.
- HAKO_LLVM_CANARY_NORMALIZE=0|1
- 開発/カナリア専用の正規化スイッチ。`1` のとき、最小の JSON 形状差(`schema_version=1``"1.0"``blocks.inst``instructions``const``ty/value` 包装)を自動補正してからビルドします。
- 既定は `0`(無効)。既存ツールの挙動は変わりません。`NYASH_CLI_VERBOSE=1` のとき形状ヒントを `[ny-llvmc/hint]` で出力します。