summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2022-04-30 20:58:42 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2022-04-30 20:58:42 +0200
commitfab72301d9089761766b389df209986c2bc38e5d (patch)
tree31539769a409546a5d822f09cd8183c40be22dda /compiler/rustc_codegen_ssa/src
parentee94ff254aceccd27919f26c02541277a3ca7dd7 (diff)
downloadrust-fab72301d9089761766b389df209986c2bc38e5d.tar.gz
rust-fab72301d9089761766b389df209986c2bc38e5d.zip
Remove config parameter of optimize_fat and avoid interior mutability for module
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/lto.rs5
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/write.rs3
2 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/lto.rs b/compiler/rustc_codegen_ssa/src/back/lto.rs
index 6dc8cb5038e..3c5b0e5cc43 100644
--- a/compiler/rustc_codegen_ssa/src/back/lto.rs
+++ b/compiler/rustc_codegen_ssa/src/back/lto.rs
@@ -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)
             }
diff --git a/compiler/rustc_codegen_ssa/src/traits/write.rs b/compiler/rustc_codegen_ssa/src/traits/write.rs
index ed0f6591809..e54ec34f1ce 100644
--- a/compiler/rustc_codegen_ssa/src/traits/write.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/write.rs
@@ -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>,