Add new_regular
and new_allocator
to ModuleCodegen
This commit is contained in:
parent
f32ca1afaf
commit
9431427cc3
6 changed files with 23 additions and 28 deletions
|
@ -686,7 +686,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
|
|||
submit_codegened_module_to_llvm(
|
||||
&backend,
|
||||
&ongoing_codegen.coordinator.sender,
|
||||
ModuleCodegen { name: llmod_id, module_llvm, kind: ModuleKind::Allocator },
|
||||
ModuleCodegen::new_allocator(llmod_id, module_llvm),
|
||||
cost,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -78,6 +78,14 @@ pub struct ModuleCodegen<M> {
|
|||
}
|
||||
|
||||
impl<M> ModuleCodegen<M> {
|
||||
pub fn new_regular(name: impl Into<String>, module: M) -> Self {
|
||||
Self { name: name.into(), module_llvm: module, kind: ModuleKind::Regular }
|
||||
}
|
||||
|
||||
pub fn new_allocator(name: impl Into<String>, module: M) -> Self {
|
||||
Self { name: name.into(), module_llvm: module, kind: ModuleKind::Allocator }
|
||||
}
|
||||
|
||||
pub fn into_compiled_module(
|
||||
self,
|
||||
emit_obj: bool,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue