Implement a implicit target feature mechanism

This commit is contained in:
daxpedda 2024-07-13 00:10:33 +02:00
parent 90521399b4
commit 80b74d397f
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F
6 changed files with 55 additions and 1 deletions

View file

@ -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