Rename some vec upcalls and trans functions from vec* to evec*

This commit is contained in:
Brian Anderson 2011-08-18 12:22:13 -07:00
parent 7903daf86f
commit 504ec8b00d
4 changed files with 20 additions and 11 deletions

View File

@ -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()),

View File

@ -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);
}
_ { }

View File

@ -308,8 +308,8 @@ copy_elements(rust_task *task, type_desc *elem_t,
}
extern "C" CDECL void
upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
rust_vec **dst_ptr, rust_vec *src, bool skip_null)
upcall_evec_append(rust_task *task, type_desc *t, type_desc *elem_t,
rust_vec **dst_ptr, rust_vec *src, bool skip_null)
{
LOG_UPCALL_ENTRY(task);
rust_vec *dst = *dst_ptr;
@ -338,6 +338,12 @@ upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
*dst_ptr = new_vec;
}
// FIXME: Transitional. Please remove.
extern "C" CDECL void
upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
rust_vec **dst_ptr, rust_vec *src, bool skip_null) {
upcall_evec_append(task, t, elem_t, dst_ptr, src, skip_null);
}
extern "C" CDECL type_desc *
upcall_get_type_desc(rust_task *task,

View File

@ -102,5 +102,6 @@ upcall_new_str
upcall_shared_malloc
upcall_shared_free
upcall_sleep
upcall_evec_append
upcall_vec_append
upcall_yield