-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API to enable ext/capabilities, and remove default capabilities #630
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,12 +96,22 @@ impl<'tcx> CodegenCx<'tcx> { | |
pub fn new(tcx: TyCtxt<'tcx>, codegen_unit: &'tcx CodegenUnit<'tcx>) -> Self { | ||
let sym = Symbols::get(); | ||
|
||
let features = tcx | ||
let mut feature_names = tcx | ||
.sess | ||
.target_features | ||
.iter() | ||
.filter(|s| *s != &sym.bindless) | ||
.map(|s| s.as_str().parse()) | ||
.map(|s| s.as_str()) | ||
.collect::<Vec<_>>(); | ||
|
||
// target_features is a HashSet, not a Vec, so we need to sort to have deterministic | ||
// compilation - otherwise, the order of capabilities in binaries depends on the iteration | ||
// order of the hashset. Sort by the string, since that's easy. | ||
feature_names.sort(); | ||
Comment on lines
+107
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be deterministic! In practice, somehow, it isn't - I hit a different order when upgrading |
||
|
||
let features = feature_names | ||
.into_iter() | ||
.map(|s| s.parse()) | ||
.collect::<Result<_, String>>() | ||
.unwrap_or_else(|error| { | ||
tcx.sess.err(&error); | ||
|
@@ -221,6 +231,7 @@ impl<'tcx> CodegenCx<'tcx> { | |
|| self.tcx.crate_name(LOCAL_CRATE) == self.sym.spirv_std | ||
|| self.tcx.crate_name(LOCAL_CRATE) == self.sym.libm | ||
|| self.tcx.crate_name(LOCAL_CRATE) == self.sym.num_traits | ||
|| self.tcx.crate_name(LOCAL_CRATE) == self.sym.glam | ||
} | ||
|
||
// FIXME(eddyb) should this just be looking at `kernel_mode`? | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be
O(1)
as a set of interned strings, maybe open an issue about simple algorithmic inefficiencies like this and leave// FIXME(#1234)
comments? At least that's what Iwouldshould do.