Further refine treatment of voidish arrays

This commit is contained in:
Niko Matsakis 2014-01-16 16:18:46 -05:00
parent 14b0abfd82
commit 4b52d899ff
2 changed files with 2 additions and 4 deletions

View File

@ -64,7 +64,7 @@ pub fn type_is_immediate(ccx: &CrateContext, ty: ty::t) -> bool {
let tcx = ccx.tcx;
let simple = ty::type_is_scalar(ty) || ty::type_is_boxed(ty) ||
ty::type_is_unique(ty) || ty::type_is_region_ptr(ty) ||
type_is_newtype_immediate(ccx, ty) ||
type_is_newtype_immediate(ccx, ty) || ty::type_is_bot(ty) ||
ty::type_is_simd(tcx, ty);
if simple {
return true;
@ -75,7 +75,7 @@ pub fn type_is_immediate(ccx: &CrateContext, ty: ty::t) -> bool {
let llty = sizing_type_of(ccx, ty);
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type)
}
_ => false
_ => type_is_voidish(ccx, ty)
}
}

View File

@ -553,7 +553,6 @@ pub fn get_base_and_byte_len(bcx: &Block,
match vstore {
ty::vstore_fixed(n) => {
assert!(!type_is_immediate(bcx.ccx(), vt.vec_ty));
let base = GEPi(bcx, llval, [0u, 0u]);
let len = Mul(bcx, C_uint(ccx, n), vt.llunit_size);
(base, len)
@ -596,7 +595,6 @@ pub fn get_base_and_len(bcx: &Block,
match vstore {
ty::vstore_fixed(n) => {
assert!(!type_is_immediate(bcx.ccx(), vt.vec_ty));
let base = GEPi(bcx, llval, [0u, 0u]);
(base, C_uint(ccx, n))
}