1
Fork 0

Querify global_backend_features

At the very least this serves to deduplicate the diagnostics that are
output about unknown target features provided via CLI.
This commit is contained in:
Simonas Kazlauskas 2021-09-24 18:02:02 +03:00
parent c97c216efd
commit df701a292c
10 changed files with 58 additions and 48 deletions

View file

@ -1033,6 +1033,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
} else {
tcx.backend_optimization_level(())
};
let backend_features = tcx.global_backend_features(());
let cgcx = CodegenContext::<B> {
backend: backend.clone(),
crate_types: sess.crate_types().to_vec(),
@ -1054,7 +1055,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
regular_module_config: regular_config,
metadata_module_config: metadata_config,
allocator_module_config: allocator_config,
tm_factory: backend.target_machine_factory(tcx.sess, ol),
tm_factory: backend.target_machine_factory(tcx.sess, ol, backend_features),
total_cgus,
msvc_imps_needed: msvc_imps_needed(tcx),
is_pe_coff: tcx.sess.target.is_like_windows,

View file

@ -134,6 +134,7 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
&self,
sess: &Session,
opt_level: config::OptLevel,
target_features: &[String],
) -> TargetMachineFactoryFn<Self>;
fn target_cpu<'b>(&self, sess: &'b Session) -> &'b str;
fn tune_cpu<'b>(&self, sess: &'b Session) -> Option<&'b str>;