Only borrow EncodedMetadata in codegen_crate

And move passing it to the linker to the driver code.
This commit is contained in:
bjorn3
2025-05-30 11:55:06 +00:00
parent c68032fd4c
commit badabab01f
12 changed files with 90 additions and 91 deletions

View File

@@ -230,20 +230,9 @@ impl CodegenBackend for GccCodegenBackend {
providers.global_backend_features = |tcx, ()| gcc_util::global_gcc_features(tcx.sess, true)
}
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> {
let target_cpu = target_cpu(tcx.sess);
let res = codegen_crate(
self.clone(),
tcx,
target_cpu.to_string(),
metadata,
need_metadata_module,
);
let res = codegen_crate(self.clone(), tcx, target_cpu.to_string(), metadata);
Box::new(res)
}