@@ -5,9 +5,6 @@ use crate::errors::{
55} ;
66use crate :: llvm;
77use libc:: c_int;
8- use rustc_codegen_ssa:: target_features:: {
9- supported_target_features, tied_target_features, RUSTC_SPECIFIC_FEATURES ,
10- } ;
118use rustc_codegen_ssa:: traits:: PrintBackendInfo ;
129use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
1310use rustc_data_structures:: small_c_str:: SmallCStr ;
@@ -17,6 +14,7 @@ use rustc_session::config::{PrintKind, PrintRequest};
1714use rustc_session:: Session ;
1815use rustc_span:: symbol:: Symbol ;
1916use rustc_target:: spec:: { MergeFunctions , PanicStrategy } ;
17+ use rustc_target:: target_features:: RUSTC_SPECIFIC_FEATURES ;
2018
2119use std:: ffi:: { c_char, c_void, CStr , CString } ;
2220use std:: path:: Path ;
@@ -278,7 +276,7 @@ pub fn check_tied_features(
278276 features : & FxHashMap < & str , bool > ,
279277) -> Option < & ' static [ & ' static str ] > {
280278 if !features. is_empty ( ) {
281- for tied in tied_target_features ( sess ) {
279+ for tied in sess . target . tied_target_features ( ) {
282280 // Tied features must be set to the same value, or not set at all
283281 let mut tied_iter = tied. iter ( ) ;
284282 let enabled = features. get ( tied_iter. next ( ) . unwrap ( ) ) ;
@@ -294,7 +292,8 @@ pub fn check_tied_features(
294292/// Must express features in the way Rust understands them
295293pub fn target_features ( sess : & Session , allow_unstable : bool ) -> Vec < Symbol > {
296294 let target_machine = create_informational_target_machine ( sess) ;
297- supported_target_features ( sess)
295+ sess. target
296+ . supported_target_features ( )
298297 . iter ( )
299298 . filter_map ( |& ( feature, gate) | {
300299 if sess. is_nightly_build ( ) || allow_unstable || gate. is_stable ( ) {
@@ -362,7 +361,9 @@ fn llvm_target_features(tm: &llvm::TargetMachine) -> Vec<(&str, &str)> {
362361fn print_target_features ( out : & mut dyn PrintBackendInfo , sess : & Session , tm : & llvm:: TargetMachine ) {
363362 let mut llvm_target_features = llvm_target_features ( tm) ;
364363 let mut known_llvm_target_features = FxHashSet :: < & ' static str > :: default ( ) ;
365- let mut rustc_target_features = supported_target_features ( sess)
364+ let mut rustc_target_features = sess
365+ . target
366+ . supported_target_features ( )
366367 . iter ( )
367368 . map ( |( feature, _gate) | {
368369 // LLVM asserts that these are sorted. LLVM and Rust both use byte comparison for these strings.
@@ -515,7 +516,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
515516 ) ;
516517
517518 // -Ctarget-features
518- let supported_features = supported_target_features ( sess ) ;
519+ let supported_features = sess . target . supported_target_features ( ) ;
519520 let mut featsmap = FxHashMap :: default ( ) ;
520521 let feats = sess
521522 . opts
0 commit comments