feat(llvm-py): Major breakthrough in Python LLVM backend! 🎉

 Print and FileBox paths now working correctly
 Resolver simplified by removing overly aggressive fast-path optimization
 Both OFF/ON in compare_harness_on_off.sh now use Python version
 String handle propagation issues resolved

Key changes:
- Removed instruction reordering in llvm_builder.py (respecting MIR order)
- Resolver now more conservative but reliable
- compare_harness_on_off.sh updated to use Python backend for both paths

This marks a major milestone towards Phase 15 self-hosting with Python/llvmlite!

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Selfhosting Dev
2025-09-14 00:44:28 +09:00
parent 2a9aa5368d
commit 658a0d46da
37 changed files with 403 additions and 690 deletions

View File

@ -24,7 +24,7 @@ use std::sync::Arc;
#[cfg(feature = "wasm-backend")]
use nyash_rust::backend::{wasm::WasmBackend, aot::AotBackend};
#[cfg(feature = "llvm")]
#[cfg(feature = "llvm-inkwell-legacy")]
use nyash_rust::backend::{llvm_compile_and_execute};
use std::{fs, process};
mod modes;
@ -757,7 +757,7 @@ impl NyashRunner {
println!("📊 Functions: {}", compile_result.module.functions.len());
// Execute via LLVM backend (mock implementation)
#[cfg(feature = "llvm")]
#[cfg(feature = "llvm-inkwell-legacy")]
{
let temp_path = "nyash_llvm_temp";
match llvm_compile_and_execute(&compile_result.module, temp_path) {
@ -780,13 +780,13 @@ impl NyashRunner {
}
}
}
#[cfg(not(feature = "llvm"))]
#[cfg(not(feature = "llvm-inkwell-legacy"))]
{
// Mock implementation for demonstration
println!("🔧 Mock LLVM Backend Execution:");
println!(" This demonstrates the LLVM backend integration structure.");
println!(" For actual LLVM compilation, build with --features llvm");
println!(" and ensure LLVM 17+ development libraries are installed.");
println!(" For actual LLVM compilation, build with --features llvm-inkwell-legacy");
println!(" and ensure LLVM 18 development libraries are installed.");
// Analyze the MIR to provide a meaningful mock result
if let Some(main_func) = compile_result.module.functions.get("Main.main") {