Rollup merge of #76832 - khyperia:backend_target_override, r=eddyb
Let backends define custom targets Add a target_override hook that takes priority over builtin targets.
This commit is contained in:
commit
c847eaa91d
5 changed files with 24 additions and 11 deletions
|
@ -15,6 +15,7 @@ use rustc_session::{
|
|||
};
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_target::abi::LayoutOf;
|
||||
use rustc_target::spec::Target;
|
||||
|
||||
pub use rustc_data_structures::sync::MetadataRef;
|
||||
|
||||
|
@ -54,6 +55,12 @@ pub trait CodegenBackend {
|
|||
fn print_passes(&self) {}
|
||||
fn print_version(&self) {}
|
||||
|
||||
/// If this plugin provides additional builtin targets, provide the one enabled by the options here.
|
||||
/// Be careful: this is called *before* init() is called.
|
||||
fn target_override(&self, _opts: &config::Options) -> Option<Target> {
|
||||
None
|
||||
}
|
||||
|
||||
fn metadata_loader(&self) -> Box<MetadataLoaderDyn>;
|
||||
fn provide(&self, _providers: &mut Providers);
|
||||
fn provide_extern(&self, _providers: &mut Providers);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue