Only borrow EncodedMetadata in codegen_crate
And move passing it to the linker to the driver code.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user