diff options
| author | Ralf Jung <post@ralfj.de> | 2022-07-05 16:53:48 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-07-09 07:27:29 -0400 |
| commit | 052651dd134c6016108c5fc50bfe4196012a6a8f (patch) | |
| tree | 437f3bc4a29001123c24acf20495ee55fbe1b5d7 /compiler/rustc_codegen_gcc/src/common.rs | |
| parent | a422b421597202554a76bee32d07b54a15631681 (diff) | |
| download | rust-052651dd134c6016108c5fc50bfe4196012a6a8f.tar.gz rust-052651dd134c6016108c5fc50bfe4196012a6a8f.zip | |
fix cranelift and gcc backends
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/common.rs')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/common.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_gcc/src/common.rs b/compiler/rustc_codegen_gcc/src/common.rs index d156f874434..fc391f53f18 100644 --- a/compiler/rustc_codegen_gcc/src/common.rs +++ b/compiler/rustc_codegen_gcc/src/common.rs @@ -9,7 +9,6 @@ use rustc_codegen_ssa::traits::{ StaticMethods, }; use rustc_middle::mir::Mutability; -use rustc_middle::ty::ScalarInt; use rustc_middle::ty::layout::{TyAndLayout, LayoutOf}; use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar}; use rustc_target::abi::{self, HasDataLayout, Pointer, Size}; @@ -159,13 +158,13 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> { None } + fn zst_to_backend(&self, _ty: Type<'gcc>) -> RValue<'gcc> { + self.const_undef(self.type_ix(0)) + } + fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, ty: Type<'gcc>) -> RValue<'gcc> { let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() }; match cv { - Scalar::Int(ScalarInt::ZST) => { - assert_eq!(0, layout.size(self).bytes()); - self.const_undef(self.type_ix(0)) - } Scalar::Int(int) => { let data = int.assert_bits(layout.size(self)); |
