Rename some vec upcalls and trans functions from vec* to evec*
This commit is contained in:
parent
7903daf86f
commit
504ec8b00d
4 changed files with 20 additions and 11 deletions
|
|
@ -37,7 +37,7 @@ type upcalls =
|
|||
shared_free: ValueRef,
|
||||
mark: ValueRef,
|
||||
new_str: ValueRef,
|
||||
vec_append: ValueRef,
|
||||
evec_append: ValueRef,
|
||||
get_type_desc: ValueRef,
|
||||
ivec_resize: ValueRef,
|
||||
ivec_spill: ValueRef,
|
||||
|
|
@ -83,8 +83,8 @@ fn declare_upcalls(_tn: type_names, tydesc_type: TypeRef,
|
|||
shared_free: dv("shared_free", ~[T_ptr(T_i8())]),
|
||||
mark: d("mark", ~[T_ptr(T_i8())], T_int()),
|
||||
new_str: d("new_str", ~[T_ptr(T_i8()), T_size_t()], T_ptr(T_str())),
|
||||
vec_append:
|
||||
d("vec_append",
|
||||
evec_append:
|
||||
d("evec_append",
|
||||
~[T_ptr(tydesc_type), T_ptr(tydesc_type),
|
||||
T_ptr(T_opaque_vec_ptr()), T_opaque_vec_ptr(), T_bool()],
|
||||
T_void()),
|
||||
|
|
|
|||
|
|
@ -2542,7 +2542,8 @@ fn trans_compare(cx: &@block_ctxt, op: ast::binop,
|
|||
}
|
||||
}
|
||||
|
||||
fn trans_vec_append(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef)
|
||||
fn trans_evec_append(cx: &@block_ctxt, t: &ty::t,
|
||||
lhs: ValueRef, rhs: ValueRef)
|
||||
-> result {
|
||||
let elt_ty = ty::sequence_element_type(bcx_tcx(cx), t);
|
||||
let skip_null = C_bool(false);
|
||||
|
|
@ -2563,7 +2564,7 @@ fn trans_vec_append(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef)
|
|||
let dst = bcx.build.PointerCast(lhs, T_ptr(T_opaque_vec_ptr()));
|
||||
let src = bcx.build.PointerCast(rhs, T_opaque_vec_ptr());
|
||||
ret rslt(bcx,
|
||||
bcx.build.Call(bcx_ccx(cx).upcalls.vec_append,
|
||||
bcx.build.Call(bcx_ccx(cx).upcalls.evec_append,
|
||||
~[cx.fcx.lltaskptr, llvec_tydesc.val,
|
||||
llelt_tydesc.val, dst, src, skip_null]));
|
||||
}
|
||||
|
|
@ -3170,12 +3171,13 @@ mod ivec {
|
|||
}
|
||||
}
|
||||
|
||||
fn trans_vec_add(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef) ->
|
||||
fn trans_evec_add(cx: &@block_ctxt, t: &ty::t,
|
||||
lhs: ValueRef, rhs: ValueRef) ->
|
||||
result {
|
||||
let r = alloc_ty(cx, t);
|
||||
let tmp = r.val;
|
||||
r = copy_val(r.bcx, INIT, tmp, lhs, t);
|
||||
let bcx = trans_vec_append(r.bcx, t, tmp, rhs).bcx;
|
||||
let bcx = trans_evec_append(r.bcx, t, tmp, rhs).bcx;
|
||||
tmp = load_if_immediate(bcx, tmp, t);
|
||||
add_clean_temp(cx, tmp, t);
|
||||
ret rslt(bcx, tmp);
|
||||
|
|
@ -3209,7 +3211,7 @@ fn trans_eager_binop(cx: &@block_ctxt, op: ast::binop, lhs: ValueRef,
|
|||
if ty::sequence_is_interior(bcx_tcx(cx), intype) {
|
||||
ret ivec::trans_add(cx, intype, lhs, rhs);
|
||||
}
|
||||
ret trans_vec_add(cx, intype, lhs, rhs);
|
||||
ret trans_evec_add(cx, intype, lhs, rhs);
|
||||
}
|
||||
if is_float {
|
||||
ret rslt(cx, cx.build.FAdd(lhs, rhs));
|
||||
|
|
@ -5028,7 +5030,7 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
|
|||
ret ivec::trans_append(rhs_res.bcx, t, lhs_res.res.val,
|
||||
rhs_res.val);
|
||||
}
|
||||
ret trans_vec_append(rhs_res.bcx, t, lhs_res.res.val,
|
||||
ret trans_evec_append(rhs_res.bcx, t, lhs_res.res.val,
|
||||
rhs_res.val);
|
||||
}
|
||||
_ { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue