diff options
| author | daxpedda <daxpedda@gmail.com> | 2024-07-13 00:10:33 +0200 |
|---|---|---|
| committer | daxpedda <daxpedda@gmail.com> | 2024-08-04 08:44:23 +0200 |
| commit | 80b74d397fffc9deaafd2b44552ba3a9107b4d5b (patch) | |
| tree | 62a2706369f5088b13cbb77ef3145f764a843fe8 /compiler/rustc_codegen_ssa/src | |
| parent | 90521399b4bfa889916cb62e2394b69f295e22cf (diff) | |
| download | rust-80b74d397fffc9deaafd2b44552ba3a9107b4d5b.tar.gz rust-80b74d397fffc9deaafd2b44552ba3a9107b4d5b.zip | |
Implement a implicit target feature mechanism
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/target_features.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index b52e6259944..127244a34f8 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -97,6 +97,14 @@ pub fn from_target_feature( Some(Symbol::intern(feature)) })); } + + for (feature, requires) in tcx.sess.target.implicit_target_features() { + if target_features.iter().any(|f| f.as_str() == *feature) + && !target_features.iter().any(|f| f.as_str() == *requires) + { + target_features.push(Symbol::intern(requires)); + } + } } /// Computes the set of target features used in a function for the purposes of |
