Remove config parameter of optimize_fat and avoid interior mutability for module
This commit is contained in:
parent
ee94ff254a
commit
fab72301d9
5 changed files with 11 additions and 17 deletions
|
@ -68,10 +68,9 @@ impl<B: WriteBackendMethods> LtoModuleCodegen<B> {
|
|||
cgcx: &CodegenContext<B>,
|
||||
) -> Result<ModuleCodegen<B::Module>, FatalError> {
|
||||
match self {
|
||||
LtoModuleCodegen::Fat { module, .. } => {
|
||||
LtoModuleCodegen::Fat { mut module, .. } => {
|
||||
{
|
||||
let config = cgcx.config(module.kind);
|
||||
B::optimize_fat(cgcx, &module, config)?;
|
||||
B::optimize_fat(cgcx, &mut module)?;
|
||||
}
|
||||
Ok(module)
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ pub trait WriteBackendMethods: 'static + Sized + Clone {
|
|||
) -> Result<(), FatalError>;
|
||||
fn optimize_fat(
|
||||
cgcx: &CodegenContext<Self>,
|
||||
llmod: &ModuleCodegen<Self::Module>,
|
||||
config: &ModuleConfig,
|
||||
llmod: &mut ModuleCodegen<Self::Module>,
|
||||
) -> Result<(), FatalError>;
|
||||
unsafe fn optimize_thin(
|
||||
cgcx: &CodegenContext<Self>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue