mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
Further refine treatment of voidish arrays
This commit is contained in:
parent
14b0abfd82
commit
4b52d899ff
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user