Remove SimpleJIT prefix from some private types

This commit is contained in:
bjorn3
2020-10-12 14:06:38 +02:00
parent 69513ee85e
commit cb2d180f2a

View File

@@ -126,10 +126,10 @@ pub struct SimpleJITModule {
isa: Box<dyn TargetIsa>, isa: Box<dyn TargetIsa>,
symbols: HashMap<String, *const u8>, symbols: HashMap<String, *const u8>,
libcall_names: Box<dyn Fn(ir::LibCall) -> String>, libcall_names: Box<dyn Fn(ir::LibCall) -> String>,
memory: SimpleJITMemoryHandle, memory: MemoryHandle,
declarations: ModuleDeclarations, declarations: ModuleDeclarations,
functions: SecondaryMap<FuncId, Option<SimpleJITCompiledBlob>>, functions: SecondaryMap<FuncId, Option<CompiledBlob>>,
data_objects: SecondaryMap<DataId, Option<SimpleJITCompiledBlob>>, data_objects: SecondaryMap<DataId, Option<CompiledBlob>>,
functions_to_finalize: Vec<FuncId>, functions_to_finalize: Vec<FuncId>,
data_objects_to_finalize: Vec<DataId>, data_objects_to_finalize: Vec<DataId>,
} }
@@ -151,14 +151,14 @@ struct StackMapRecord {
} }
#[derive(Clone)] #[derive(Clone)]
struct SimpleJITCompiledBlob { struct CompiledBlob {
ptr: *mut u8, ptr: *mut u8,
size: usize, size: usize,
relocs: Vec<RelocRecord>, relocs: Vec<RelocRecord>,
} }
/// A handle to allow freeing memory allocated by the `Module`. /// A handle to allow freeing memory allocated by the `Module`.
struct SimpleJITMemoryHandle { struct MemoryHandle {
code: Memory, code: Memory,
readonly: Memory, readonly: Memory,
writable: Memory, writable: Memory,
@@ -167,10 +167,10 @@ struct SimpleJITMemoryHandle {
/// A `SimpleJITProduct` allows looking up the addresses of all functions and data objects /// A `SimpleJITProduct` allows looking up the addresses of all functions and data objects
/// defined in the original module. /// defined in the original module.
pub struct SimpleJITProduct { pub struct SimpleJITProduct {
memory: SimpleJITMemoryHandle, memory: MemoryHandle,
declarations: ModuleDeclarations, declarations: ModuleDeclarations,
functions: SecondaryMap<FuncId, Option<SimpleJITCompiledBlob>>, functions: SecondaryMap<FuncId, Option<CompiledBlob>>,
data_objects: SecondaryMap<DataId, Option<SimpleJITCompiledBlob>>, data_objects: SecondaryMap<DataId, Option<CompiledBlob>>,
} }
impl SimpleJITProduct { impl SimpleJITProduct {
@@ -414,7 +414,7 @@ impl SimpleJITModule {
/// Create a new `SimpleJITModule`. /// Create a new `SimpleJITModule`.
pub fn new(builder: SimpleJITBuilder) -> Self { pub fn new(builder: SimpleJITBuilder) -> Self {
let memory = SimpleJITMemoryHandle { let memory = MemoryHandle {
code: Memory::new(), code: Memory::new(),
readonly: Memory::new(), readonly: Memory::new(),
writable: Memory::new(), writable: Memory::new(),
@@ -515,7 +515,7 @@ impl<'simple_jit_backend> Module for SimpleJITModule {
) )
}; };
self.functions[id] = Some(SimpleJITCompiledBlob { self.functions[id] = Some(CompiledBlob {
ptr, ptr,
size, size,
relocs: reloc_sink.relocs, relocs: reloc_sink.relocs,
@@ -557,7 +557,7 @@ impl<'simple_jit_backend> Module for SimpleJITModule {
ptr::copy_nonoverlapping(bytes.as_ptr(), ptr, size); ptr::copy_nonoverlapping(bytes.as_ptr(), ptr, size);
} }
self.functions[id] = Some(SimpleJITCompiledBlob { self.functions[id] = Some(CompiledBlob {
ptr, ptr,
size, size,
relocs: vec![], relocs: vec![],
@@ -639,11 +639,7 @@ impl<'simple_jit_backend> Module for SimpleJITModule {
}); });
} }
self.data_objects[id] = Some(SimpleJITCompiledBlob { self.data_objects[id] = Some(CompiledBlob { ptr, size, relocs });
ptr,
size,
relocs,
});
Ok(()) Ok(())
} }