refactor(mir): phase260 p0.1 strangler hardening + smoke fixtures

This commit is contained in:
2025-12-21 05:47:37 +09:00
parent 4dfe3349bf
commit 1fe5be347d
28 changed files with 442 additions and 504 deletions

View File

@ -488,6 +488,41 @@ impl NyashRunner {
}
}
// CLI emit: MIR JSON / EXE
// NOTE: These flags are CLI-level and should work regardless of selected backend.
// The VM runner is a common default backend, so we honor them here and exit early.
{
let groups = self.config.as_groups();
if let Some(path) = groups.emit.emit_mir_json.as_ref() {
let p = std::path::Path::new(path);
if let Err(e) = crate::runner::mir_json_emit::emit_mir_json_for_harness_bin(
&module_vm, p,
) {
eprintln!("❌ MIR JSON emit error: {}", e);
process::exit(1);
}
if !quiet_pipe {
println!("MIR JSON written: {}", p.display());
}
process::exit(0);
}
if let Some(exe_out) = groups.emit.emit_exe.as_ref() {
if let Err(e) = crate::runner::modes::common_util::exec::ny_llvmc_emit_exe_bin(
&module_vm,
exe_out,
groups.emit.emit_exe_nyrt.as_deref(),
groups.emit.emit_exe_libs.as_deref(),
) {
eprintln!("{}", e);
process::exit(1);
}
if !quiet_pipe {
println!("EXE written: {}", exe_out);
}
process::exit(0);
}
}
// Optional: dump MIR for diagnostics
// Phase 25.1: File dump for offline analysis (ParserBox等)
if let Ok(path) = std::env::var("RUST_MIR_DUMP_PATH") {