Skip to content

Commit 6f1b06e

Browse files
committed
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.
1 parent 6ef0840 commit 6f1b06e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_trans/trans/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -
244244
return false;
245245
}
246246
match ty.sty {
247-
ty::ty_struct(..) | ty::ty_enum(..) | ty::ty_tup(..) |
247+
ty::ty_struct(..) | ty::ty_enum(..) | ty::ty_tup(..) | ty::ty_vec(_, Some(_)) |
248248
ty::ty_unboxed_closure(..) => {
249249
let llty = sizing_type_of(ccx, ty);
250250
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type())

0 commit comments

Comments
 (0)