@@ -5,9 +5,6 @@ use crate::errors::{
5
5
} ;
6
6
use crate :: llvm;
7
7
use libc:: c_int;
8
- use rustc_codegen_ssa:: target_features:: {
9
- supported_target_features, tied_target_features, RUSTC_SPECIFIC_FEATURES ,
10
- } ;
11
8
use rustc_codegen_ssa:: traits:: PrintBackendInfo ;
12
9
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
13
10
use rustc_data_structures:: small_c_str:: SmallCStr ;
@@ -17,6 +14,7 @@ use rustc_session::config::{PrintKind, PrintRequest};
17
14
use rustc_session:: Session ;
18
15
use rustc_span:: symbol:: Symbol ;
19
16
use rustc_target:: spec:: { MergeFunctions , PanicStrategy } ;
17
+ use rustc_target:: target_features:: RUSTC_SPECIFIC_FEATURES ;
20
18
21
19
use std:: ffi:: { c_char, c_void, CStr , CString } ;
22
20
use std:: path:: Path ;
@@ -278,7 +276,7 @@ pub fn check_tied_features(
278
276
features : & FxHashMap < & str , bool > ,
279
277
) -> Option < & ' static [ & ' static str ] > {
280
278
if !features. is_empty ( ) {
281
- for tied in tied_target_features ( sess ) {
279
+ for tied in sess . target . tied_target_features ( ) {
282
280
// Tied features must be set to the same value, or not set at all
283
281
let mut tied_iter = tied. iter ( ) ;
284
282
let enabled = features. get ( tied_iter. next ( ) . unwrap ( ) ) ;
@@ -294,7 +292,8 @@ pub fn check_tied_features(
294
292
/// Must express features in the way Rust understands them
295
293
pub fn target_features ( sess : & Session , allow_unstable : bool ) -> Vec < Symbol > {
296
294
let target_machine = create_informational_target_machine ( sess) ;
297
- supported_target_features ( sess)
295
+ sess. target
296
+ . supported_target_features ( )
298
297
. iter ( )
299
298
. filter_map ( |& ( feature, gate) | {
300
299
if sess. is_nightly_build ( ) || allow_unstable || gate. is_stable ( ) {
@@ -362,7 +361,9 @@ fn llvm_target_features(tm: &llvm::TargetMachine) -> Vec<(&str, &str)> {
362
361
fn print_target_features ( out : & mut dyn PrintBackendInfo , sess : & Session , tm : & llvm:: TargetMachine ) {
363
362
let mut llvm_target_features = llvm_target_features ( tm) ;
364
363
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 ( )
366
367
. iter ( )
367
368
. map ( |( feature, _gate) | {
368
369
// 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
515
516
) ;
516
517
517
518
// -Ctarget-features
518
- let supported_features = supported_target_features ( sess ) ;
519
+ let supported_features = sess . target . supported_target_features ( ) ;
519
520
let mut featsmap = FxHashMap :: default ( ) ;
520
521
let feats = sess
521
522
. opts
0 commit comments