Merge commit '48d60ab7c5' into libgccjit-codegen

This commit is contained in:
Antoni Boucher 2021-09-17 17:52:40 -04:00
commit df487317d0
24 changed files with 774 additions and 387 deletions

View file

@ -12,10 +12,11 @@ use rustc_codegen_ssa::traits::{
};
use rustc_middle::bug;
use rustc_middle::mir::Mutability;
use rustc_middle::ty::{layout::TyAndLayout, ScalarInt};
use rustc_mir::interpret::{Allocation, GlobalAlloc, Scalar};
use rustc_middle::ty::ScalarInt;
use rustc_middle::ty::layout::{TyAndLayout, LayoutOf};
use rustc_middle::mir::interpret::{Allocation, GlobalAlloc, Scalar};
use rustc_span::Symbol;
use rustc_target::abi::{self, HasDataLayout, LayoutOf, Pointer, Size};
use rustc_target::abi::{self, HasDataLayout, Pointer, Size};
use crate::consts::const_alloc_to_gcc;
use crate::context::CodegenCx;
@ -212,7 +213,7 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
None
}
fn scalar_to_backend(&self, cv: Scalar, layout: &abi::Scalar, ty: Type<'gcc>) -> RValue<'gcc> {
fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, ty: Type<'gcc>) -> RValue<'gcc> {
let bitsize = if layout.is_bool() { 1 } else { layout.value.size(self).bits() };
match cv {
Scalar::Int(ScalarInt::ZST) => {