Add new_regular and new_allocator to ModuleCodegen

This commit is contained in:
DianQK
2025-02-06 21:59:36 +08:00
parent f32ca1afaf
commit 9431427cc3
6 changed files with 23 additions and 28 deletions

View File

@@ -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,