about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/lib.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-05-30 11:55:06 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-06-03 10:04:34 +0000
commitbadabab01f15f156dbb6ce39df4a339006fbfae1 (patch)
treefec9ba97cb1f0d7770f52316dfcab95e8bac589f /compiler/rustc_codegen_cranelift/src/lib.rs
parentc68032fd4c442d275f4daa571ba19c076106b490 (diff)
downloadrust-badabab01f15f156dbb6ce39df4a339006fbfae1.tar.gz
rust-badabab01f15f156dbb6ce39df4a339006fbfae1.zip
Only borrow EncodedMetadata in codegen_crate
And move passing it to the linker to the driver code.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/lib.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/lib.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs
index 8ef623cde00..277d4f16f19 100644
--- a/compiler/rustc_codegen_cranelift/src/lib.rs
+++ b/compiler/rustc_codegen_cranelift/src/lib.rs
@@ -238,12 +238,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
         println!("Cranelift version: {}", cranelift_codegen::VERSION);
     }
 
-    fn codegen_crate(
-        &self,
-        tcx: TyCtxt<'_>,
-        metadata: EncodedMetadata,
-        need_metadata_module: bool,
-    ) -> Box<dyn Any> {
+    fn codegen_crate(&self, tcx: TyCtxt<'_>, metadata: Option<&EncodedMetadata>) -> Box<dyn Any> {
         info!("codegen crate {}", tcx.crate_name(LOCAL_CRATE));
         let config = self.config.clone().unwrap_or_else(|| {
             BackendConfig::from_opts(&tcx.sess.opts.cg.llvm_args)
@@ -256,7 +251,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
             #[cfg(not(feature = "jit"))]
             tcx.dcx().fatal("jit support was disabled when compiling rustc_codegen_cranelift");
         } else {
-            driver::aot::run_aot(tcx, metadata, need_metadata_module)
+            driver::aot::run_aot(tcx, metadata)
         }
     }