Skip to content

Commit f780364

Browse files
authored
rustup update (#840)
* rustup update * asm->core::arch::asm
1 parent fe5c771 commit f780364

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+111
-74
lines changed

crates/rustc_codegen_spirv/src/abi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> {
386386
if let Variants::Single { index } = self.variants {
387387
for i in self.fields.index_by_increasing_offset() {
388388
let field = &adt.variants[index].fields[i];
389-
field_names.push(field.ident.name.to_ident_string());
389+
field_names.push(field.name.to_ident_string());
390390
}
391391
}
392392
}
@@ -664,7 +664,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
664664
if let Variants::Single { index } = ty.variants {
665665
if let TyKind::Adt(adt, _) = ty.ty.kind() {
666666
let field = &adt.variants[index].fields[i];
667-
field_names.push(field.ident.name.to_ident_string());
667+
field_names.push(field.name.to_ident_string());
668668
} else {
669669
field_names.push(format!("{}", i));
670670
}
@@ -729,7 +729,7 @@ impl fmt::Display for TyLayoutNameKey<'_> {
729729
write!(f, "{}", self.ty)?;
730730
if let (TyKind::Adt(def, _), Some(index)) = (self.ty.kind(), self.variant) {
731731
if def.is_enum() && !def.variants.is_empty() {
732-
write!(f, "::{}", def.variants[index].ident)?;
732+
write!(f, "::{}", def.variants[index].name)?;
733733
}
734734
}
735735
if let (TyKind::Generator(_, _, _), Some(index)) = (self.ty.kind(), self.variant) {

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
22402240
self.intcast(val, dest_ty, false)
22412241
}
22422242

2243-
fn do_not_inline(&mut self, _llret: Self::Value) {
2243+
fn apply_attrs_to_cleanup_callsite(&mut self, _llret: Self::Value) {
22442244
// Ignore
22452245
}
22462246
}

crates/rustc_codegen_spirv/src/builder/spirv_asm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
7171
options: InlineAsmOptions,
7272
_line_spans: &[Span],
7373
_instance: Instance<'_>,
74+
_dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>,
7475
) {
7576
const SUPPORTED_OPTIONS: InlineAsmOptions = InlineAsmOptions::NORETURN;
7677
let unsupported_options = options & !SUPPORTED_OPTIONS;

crates/rustc_codegen_spirv/src/codegen_cx/declare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'tcx> CodegenCx<'tcx> {
9191

9292
// HACK(eddyb) this is a bit roundabout, but the easiest way to get a
9393
// fully absolute path that contains at least as much information as
94-
// `instance.to_string()` (at least with `-Z symbol-mangling-version=v0`).
94+
// `instance.to_string()` (at least with `-C symbol-mangling-version=v0`).
9595
// While we could use the mangled symbol instead, like we do for linkage,
9696
// `OpName` is more of a debugging aid, so not having to separately
9797
// demangle the SPIR-V can help. However, if some tools assume `OpName`

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'tcx> CodegenCx<'tcx> {
9797
// target_features is a HashSet, not a Vec, so we need to sort to have deterministic
9898
// compilation - otherwise, the order of capabilities in binaries depends on the iteration
9999
// order of the hashset. Sort by the string, since that's easy.
100-
feature_names.sort();
100+
feature_names.sort_unstable();
101101

102102
let features = feature_names
103103
.into_iter()

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ impl CodegenBackend for SpirvCodegenBackend {
316316
&self,
317317
ongoing_codegen: Box<dyn Any>,
318318
sess: &Session,
319+
_outputs: &OutputFilenames,
319320
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
320321
let (codegen_results, work_products) = ongoing_codegen
321322
.downcast::<OngoingCodegen<Self>>()
@@ -338,7 +339,7 @@ impl CodegenBackend for SpirvCodegenBackend {
338339
sess,
339340
&codegen_results,
340341
outputs,
341-
&codegen_results.crate_info.local_crate_name.as_str(),
342+
codegen_results.crate_info.local_crate_name.as_str(),
342343
);
343344
drop(timer);
344345

@@ -454,15 +455,6 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
454455
Self::Module::new()
455456
}
456457

457-
fn write_compressed_metadata<'tcx>(
458-
&self,
459-
_: TyCtxt<'tcx>,
460-
_: &EncodedMetadata,
461-
_: &mut Self::Module,
462-
) {
463-
// Ignore for now.
464-
}
465-
466458
fn codegen_allocator<'tcx>(
467459
&self,
468460
_: TyCtxt<'tcx>,

crates/spirv-builder/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,20 @@ impl SpirvBuilder {
196196
}
197197

198198
/// Whether to print build.rs cargo metadata (e.g. cargo:rustc-env=var=val). Defaults to [`MetadataPrintout::Full`].
199+
#[must_use]
199200
pub fn print_metadata(mut self, v: MetadataPrintout) -> Self {
200201
self.print_metadata = v;
201202
self
202203
}
203204

205+
#[must_use]
204206
pub fn deny_warnings(mut self, v: bool) -> Self {
205207
self.deny_warnings = v;
206208
self
207209
}
208210

209211
/// Build in release. Defaults to true.
212+
#[must_use]
210213
pub fn release(mut self, v: bool) -> Self {
211214
self.release = v;
212215
self
@@ -215,54 +218,62 @@ impl SpirvBuilder {
215218
/// Splits the resulting SPIR-V file into one module per entry point. This is useful in cases
216219
/// where ecosystem tooling has bugs around multiple entry points per module - having all entry
217220
/// points bundled into a single file is the preferred system.
221+
#[must_use]
218222
pub fn multimodule(mut self, v: bool) -> Self {
219223
self.multimodule = v;
220224
self
221225
}
222226

223227
/// Sets the level of metadata (primarily `OpName` and `OpLine`) included in the SPIR-V binary.
224228
/// Including metadata significantly increases binary size.
229+
#[must_use]
225230
pub fn spirv_metadata(mut self, v: SpirvMetadata) -> Self {
226231
self.spirv_metadata = v;
227232
self
228233
}
229234

230235
/// Adds a capability to the SPIR-V module. Checking if a capability is enabled in code can be
231236
/// done via `#[cfg(target_feature = "TheCapability")]`.
237+
#[must_use]
232238
pub fn capability(mut self, capability: Capability) -> Self {
233239
self.capabilities.push(capability);
234240
self
235241
}
236242

237243
/// Adds an extension to the SPIR-V module. Checking if an extension is enabled in code can be
238244
/// done via `#[cfg(target_feature = "ext:the_extension")]`.
245+
#[must_use]
239246
pub fn extension(mut self, extension: impl Into<String>) -> Self {
240247
self.extensions.push(extension.into());
241248
self
242249
}
243250

244251
/// Allow store from one struct type to a different type with compatible layout and members.
252+
#[must_use]
245253
pub fn relax_struct_store(mut self, v: bool) -> Self {
246254
self.relax_struct_store = v;
247255
self
248256
}
249257

250258
/// Allow allocating an object of a pointer type and returning a pointer value from a function
251259
/// in logical addressing mode
260+
#[must_use]
252261
pub fn relax_logical_pointer(mut self, v: bool) -> Self {
253262
self.relax_logical_pointer = v;
254263
self
255264
}
256265

257266
/// Enable `VK_KHR_relaxed_block_layout` when checking standard uniform, storage buffer, and
258267
/// push constant layouts. This is the default when targeting Vulkan 1.1 or later.
268+
#[must_use]
259269
pub fn relax_block_layout(mut self, v: bool) -> Self {
260270
self.relax_block_layout = v;
261271
self
262272
}
263273

264274
/// Enable `VK_KHR_uniform_buffer_standard_layout` when checking standard uniform buffer
265275
/// layouts.
276+
#[must_use]
266277
pub fn uniform_buffer_standard_layout(mut self, v: bool) -> Self {
267278
self.uniform_buffer_standard_layout = v;
268279
self
@@ -271,19 +282,22 @@ impl SpirvBuilder {
271282
/// Enable `VK_EXT_scalar_block_layout` when checking standard uniform, storage buffer, and
272283
/// push constant layouts. Scalar layout rules are more permissive than relaxed block layout so
273284
/// in effect this will override the --relax-block-layout option.
285+
#[must_use]
274286
pub fn scalar_block_layout(mut self, v: bool) -> Self {
275287
self.scalar_block_layout = v;
276288
self
277289
}
278290

279291
/// Skip checking standard uniform/storage buffer layout. Overrides any --relax-block-layout or
280292
/// --scalar-block-layout option.
293+
#[must_use]
281294
pub fn skip_block_layout(mut self, v: bool) -> Self {
282295
self.skip_block_layout = v;
283296
self
284297
}
285298

286299
/// Preserve unused descriptor bindings. Useful for reflection.
300+
#[must_use]
287301
pub fn preserve_bindings(mut self, v: bool) -> Self {
288302
self.preserve_bindings = v;
289303
self
@@ -405,7 +419,7 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
405419

406420
let mut rustflags = vec![
407421
format!("-Zcodegen-backend={}", rustc_codegen_spirv.display()),
408-
"-Zsymbol-mangling-version=v0".to_string(),
422+
"-Csymbol-mangling-version=v0".to_string(),
409423
];
410424

411425
let mut llvm_args = vec![];

crates/spirv-std/macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
600600
let op_string = format!("%string = OpString {:?}", format_string);
601601

602602
let output = quote::quote! {
603-
asm!(
603+
::core::arch::asm!(
604604
"%void = OpTypeVoid",
605605
#op_string,
606606
"%debug_printf = OpExtInstImport \"NonSemantic.DebugPrintf\"",

crates/spirv-std/src/arch.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use crate::{
88
scalar::Scalar,
99
vector::Vector,
1010
};
11+
#[cfg(target_arch = "spirv")]
12+
use core::arch::asm;
1113

1214
mod barrier;
1315
mod demote_to_helper_invocation_ext;

crates/spirv-std/src/arch/barrier.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#[cfg(target_arch = "spirv")]
2+
use core::arch::asm;
3+
14
/// Wait for other invocations of this module to reach the current point
25
/// of execution.
36
///

0 commit comments

Comments
 (0)