Pass small fixed-size arrays as immediates

Currently even small fixed-size arrays are passed as indirect
parameters, which seems to be just an oversight. Let's handle them the
same as structs of the same size, passing them as immediate values.
This commit is contained in:
Björn Steinbrink 2015-01-08 16:34:09 +01:00
parent 6ef08406dc
commit 6f1b06eb65

View File

@ -244,7 +244,7 @@ pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -
return false;
}
match ty.sty {
ty::ty_struct(..) | ty::ty_enum(..) | ty::ty_tup(..) |
ty::ty_struct(..) | ty::ty_enum(..) | ty::ty_tup(..) | ty::ty_vec(_, Some(_)) |
ty::ty_unboxed_closure(..) => {
let llty = sizing_type_of(ccx, ty);
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type())