diff --git a/docs/ENV_VARS.md b/docs/ENV_VARS.md index c6682996..aa6b14e1 100644 --- a/docs/ENV_VARS.md +++ b/docs/ENV_VARS.md @@ -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]` で出力します。