feat(phase-9.78): Improve MIR generation for built-in Box types and enhance LLVM mock

- Fix MIR builder to handle built-in Box types (IntegerBox, StringBox, etc.) specially
- Generate MIR with actual constant values instead of ref_new instructions
- Enhance LLVM mock compiler with MIR interpreter foundation
- Add value storage HashMap for future MIR instruction interpretation

This enables proper MIR generation where 'new IntegerBox(42)' becomes '%0 = const 42'
instead of '%0 = ref_new "IntegerBox"'. This is essential for future LLVM code generation.

Example MIR improvement:
Before:
  %1 = const "IntegerBox"
  %0 = ref_new %1

After:
  %0 = const 42

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-18 19:29:24 +09:00
parent e0ae7f0a1c
commit 9d78ecd089
3 changed files with 150 additions and 41 deletions

View File

@ -16,7 +16,7 @@ pub fn compile_and_execute(
mir_module: &MirModule,
output_path: &str,
) -> Result<Box<dyn NyashBox>, String> {
let compiler = compiler::LLVMCompiler::new()?;
let mut compiler = compiler::LLVMCompiler::new()?;
compiler.compile_and_execute(mir_module, output_path)
}