llvm: restore codegen and interpreter pipeline

This commit is contained in:
moe-charm
2025-09-11 12:14:11 +09:00
parent 93e571103f
commit 94156251a5
5 changed files with 382 additions and 193 deletions

View File

@ -0,0 +1,15 @@
use super::LLVMCompiler;
use crate::box_trait::NyashBox;
use crate::mir::function::MirModule;
impl LLVMCompiler {
pub fn compile_and_execute(
&mut self,
mir_module: &MirModule,
temp_path: &str,
) -> Result<Box<dyn NyashBox>, String> {
let obj_path = format!("{}.o", temp_path);
self.compile_module(mir_module, &obj_path)?;
self.run_interpreter(mir_module)
}
}