Add new_regular and new_allocator to ModuleCodegen
This commit is contained in:
@@ -306,11 +306,8 @@ fn fat_lto(
|
||||
assert!(!serialized_modules.is_empty(), "must have at least one serialized module");
|
||||
let (buffer, name) = serialized_modules.remove(0);
|
||||
info!("no in-memory regular modules to choose from, parsing {:?}", name);
|
||||
ModuleCodegen {
|
||||
module_llvm: ModuleLlvm::parse(cgcx, &name, buffer.data(), dcx)?,
|
||||
name: name.into_string().unwrap(),
|
||||
kind: ModuleKind::Regular,
|
||||
}
|
||||
let llvm_module = ModuleLlvm::parse(cgcx, &name, buffer.data(), dcx)?;
|
||||
ModuleCodegen::new_regular(name.into_string().unwrap(), llvm_module)
|
||||
}
|
||||
};
|
||||
{
|
||||
@@ -778,11 +775,7 @@ pub(crate) unsafe fn optimize_thin_module(
|
||||
// crates but for locally codegened modules we may be able to reuse
|
||||
// that LLVM Context and Module.
|
||||
let module_llvm = ModuleLlvm::parse(cgcx, module_name, thin_module.data(), dcx)?;
|
||||
let mut module = ModuleCodegen {
|
||||
module_llvm,
|
||||
name: thin_module.name().to_string(),
|
||||
kind: ModuleKind::Regular,
|
||||
};
|
||||
let mut module = ModuleCodegen::new_regular(thin_module.name(), module_llvm);
|
||||
{
|
||||
let target = &*module.module_llvm.tm;
|
||||
let llmod = module.module_llvm.llmod();
|
||||
|
||||
Reference in New Issue
Block a user