Skip to content

Commit 277b94c

Browse files
fee1-deadFirestar99
authored andcommitted
fix assert failure
1 parent 8a6c332 commit 277b94c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

crates/rustc_codegen_spirv/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {",
237237
src = src.replace("alloca(field.size,", "typed_alloca(llfield_ty,");
238238
}
239239

240+
// HACK(fee1-dead): our backend type number doesn't always match the type of the value. Should fix?
241+
if relative_path == Path::new("src/mir/rvalue.rs") {
242+
src = src.replace(
243+
"debug_assert_eq!(bx.cx().val_ty(imm), from_backend_ty);",
244+
"",
245+
);
246+
}
247+
240248
fs::write(out_path, src)?;
241249
}
242250
}

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3249,6 +3249,10 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
32493249
// ignore
32503250
}
32513251

3252+
#[tracing::instrument(
3253+
level = "debug",
3254+
skip(self, callee_ty, _fn_attrs, fn_abi, callee, args, funclet)
3255+
)]
32523256
fn call(
32533257
&mut self,
32543258
callee_ty: Self::Type,
@@ -3259,9 +3263,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
32593263
funclet: Option<&Self::Funclet>,
32603264
instance: Option<ty::Instance<'tcx>>,
32613265
) -> Self::Value {
3262-
let span = tracing::span!(tracing::Level::DEBUG, "call");
3263-
let _enter = span.enter();
3264-
32653266
if funclet.is_some() {
32663267
self.fatal("TODO: Funclets are not supported");
32673268
}

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
483483

484484
// ... and now that we have everything pre-defined, fill out those definitions.
485485
for &(mono_item, mono_item_data) in &mono_items {
486+
tracing::trace!(?mono_item, "defining");
486487
mono_item.define::<Builder<'_, '_>>(cx, cgu_name.as_str(), mono_item_data);
487488
}
488489

crates/rustc_codegen_spirv/src/spirv_type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,5 +850,6 @@ impl<'tcx> CodegenCx<'tcx> {
850850
ty = ty.debug(id, self)
851851
);
852852
}
853+
tracing::trace!(?id, "type_cache_def, ty={:?}", self.debug_type(id));
853854
}
854855
}

0 commit comments

Comments
 (0)