mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 05:31:32 +00:00
Update module to be held by Rc<RefCell<>> so that we can pass it to LLVMFunctionCodeGenerator.
Use that to generate distinct TBAA labels for distinct local variables.
This commit is contained in:
@ -9,12 +9,14 @@ use inkwell::{
|
||||
use libc::c_char;
|
||||
use std::{
|
||||
any::Any,
|
||||
cell::RefCell,
|
||||
ffi::{c_void, CString},
|
||||
fs::File,
|
||||
io::Write,
|
||||
mem,
|
||||
ops::Deref,
|
||||
ptr::{self, NonNull},
|
||||
rc::Rc,
|
||||
slice, str,
|
||||
sync::{Arc, Once},
|
||||
};
|
||||
@ -167,14 +169,14 @@ pub struct LLVMBackend {
|
||||
|
||||
impl LLVMBackend {
|
||||
pub fn new(
|
||||
module: Module,
|
||||
module: Rc<RefCell<Module>>,
|
||||
_intrinsics: Intrinsics,
|
||||
_stackmaps: &StackmapRegistry,
|
||||
_module_info: &ModuleInfo,
|
||||
target_machine: &TargetMachine,
|
||||
) -> (Self, LLVMCache) {
|
||||
let memory_buffer = target_machine
|
||||
.write_to_memory_buffer(&module, FileType::Object)
|
||||
.write_to_memory_buffer(&module.borrow_mut(), FileType::Object)
|
||||
.unwrap();
|
||||
let mem_buf_slice = memory_buffer.as_slice();
|
||||
|
||||
|
Reference in New Issue
Block a user