about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-14 12:58:58 +0000
committerbors <bors@rust-lang.org>2021-05-14 12:58:58 +0000
commit75da570d784a798a34ff1e5048cd9a6a2fb23170 (patch)
tree7e2ffecffbd250a725092db3d0bc5190c52b4fdb /compiler/rustc_codegen_cranelift/src/lib.rs
parent36a4d14c7edba21bba14df00b9e6e4a111dfc6f2 (diff)
parent6381aaf8ae2df01cdb70b6f3123153cf4f1e03cd (diff)
downloadrust-75da570d784a798a34ff1e5048cd9a6a2fb23170.tar.gz
rust-75da570d784a798a34ff1e5048cd9a6a2fb23170.zip
Auto merge of #83640 - bjorn3:shared_metadata_reader, r=nagisa
Use the object crate for metadata reading

This allows sharing the metadata reader between cg_llvm, cg_clif and other codegen backends.

This is not currently useful for rlib reading with cg_spirv ([rust-gpu](https://github.com/EmbarkStudios/rust-gpu/)) as it uses tar rather than ar as .rlib format, but it is useful for dylib reading required for loading proc macros. (cc `@eddyb)`

The object crate is already trusted as dependency of libstd through backtrace. As far as I know it supports reading all object file formats used by targets for which we support rust dylibs with crate metadata, but I am not certain. If this happens to not be the case, I could keep using LLVM for reading dylib metadata.

Marked as WIP for a perf run and as it is based on #83637.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/lib.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs
index 4271f695f91..ff6e1856059 100644
--- a/compiler/rustc_codegen_cranelift/src/lib.rs
+++ b/compiler/rustc_codegen_cranelift/src/lib.rs
@@ -165,7 +165,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
     }
 
     fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
-        Box::new(crate::metadata::CraneliftMetadataLoader)
+        Box::new(rustc_codegen_ssa::back::metadata::DefaultMetadataLoader)
     }
 
     fn provide(&self, _providers: &mut Providers) {}