Provide a default provide* implementation for CodegenBackend

Both cg_llvm and cg_clif don't override it. cg_spirv does override it,
so it needs to be preserved.
This commit is contained in:
bjorn3 2021-05-29 14:51:27 +02:00
parent c4c2ab57a4
commit 092bc2b744
3 changed files with 2 additions and 9 deletions

View file

@ -29,7 +29,6 @@ use rustc_codegen_ssa::CodegenResults;
use rustc_errors::ErrorReported;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader};
use rustc_middle::ty::query::Providers;
use rustc_session::config::OutputFilenames;
use rustc_session::Session;
@ -168,9 +167,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
Box::new(rustc_codegen_ssa::back::metadata::DefaultMetadataLoader)
}
fn provide(&self, _providers: &mut Providers) {}
fn provide_extern(&self, _providers: &mut Providers) {}
fn target_features(&self, _sess: &Session) -> Vec<rustc_span::Symbol> {
vec![]
}

View file

@ -252,9 +252,6 @@ impl CodegenBackend for LlvmCodegenBackend {
Box::new(rustc_codegen_ssa::back::metadata::DefaultMetadataLoader)
}
fn provide(&self, _providers: &mut ty::query::Providers) {}
fn provide_extern(&self, _providers: &mut ty::query::Providers) {}
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx>,

View file

@ -64,8 +64,8 @@ pub trait CodegenBackend {
}
fn metadata_loader(&self) -> Box<MetadataLoaderDyn>;
fn provide(&self, _providers: &mut Providers);
fn provide_extern(&self, _providers: &mut Providers);
fn provide(&self, _providers: &mut Providers) {}
fn provide_extern(&self, _providers: &mut Providers) {}
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx>,