llvm: restore codegen and interpreter pipeline
This commit is contained in:
15
src/backend/llvm/compiler/aot.rs
Normal file
15
src/backend/llvm/compiler/aot.rs
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user