diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2021-09-24 18:02:02 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2022-03-01 01:57:25 +0200 |
| commit | df701a292ce552fddad2048cfcb6edaf90222d85 (patch) | |
| tree | 7e299460e96c3f5eb09851ef56e729332caedff3 /compiler/rustc_codegen_llvm/src/lib.rs | |
| parent | c97c216efd542fbec5a7ccf9555f3cebb3198cec (diff) | |
| download | rust-df701a292ce552fddad2048cfcb6edaf90222d85.tar.gz rust-df701a292ce552fddad2048cfcb6edaf90222d85.zip | |
Querify `global_backend_features`
At the very least this serves to deduplicate the diagnostics that are output about unknown target features provided via CLI.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/lib.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index c2211005a03..09c2c4ec771 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -11,6 +11,7 @@ #![feature(extern_types)] #![feature(once_cell)] #![feature(nll)] +#![feature(iter_intersperse)] #![recursion_limit = "256"] #![allow(rustc::potential_query_instability)] @@ -32,6 +33,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_errors::{ErrorReported, FatalError, Handler}; use rustc_metadata::EncodedMetadata; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; +use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::config::{OptLevel, OutputFilenames, PrintRequest}; use rustc_session::Session; @@ -126,8 +128,9 @@ impl ExtraBackendMethods for LlvmCodegenBackend { &self, sess: &Session, optlvl: OptLevel, + target_features: &[String], ) -> TargetMachineFactoryFn<Self> { - back::write::target_machine_factory(sess, optlvl) + back::write::target_machine_factory(sess, optlvl, target_features) } fn target_cpu<'b>(&self, sess: &'b Session) -> &'b str { llvm_util::target_cpu(sess) @@ -251,6 +254,11 @@ impl CodegenBackend for LlvmCodegenBackend { llvm_util::init(sess); // Make sure llvm is inited } + fn provide(&self, providers: &mut Providers) { + providers.global_backend_features = + |tcx, ()| llvm_util::global_llvm_features(tcx.sess, true) + } + fn print(&self, req: PrintRequest, sess: &Session) { match req { PrintRequest::RelocationModels => { |
