Skip to content

Commit 504ec8b

Browse files
committed
Rename some vec upcalls and trans functions from vec* to evec*
1 parent 7903daf commit 504ec8b

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

src/comp/back/upcall.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type upcalls =
3737
shared_free: ValueRef,
3838
mark: ValueRef,
3939
new_str: ValueRef,
40-
vec_append: ValueRef,
40+
evec_append: ValueRef,
4141
get_type_desc: ValueRef,
4242
ivec_resize: ValueRef,
4343
ivec_spill: ValueRef,
@@ -83,8 +83,8 @@ fn declare_upcalls(_tn: type_names, tydesc_type: TypeRef,
8383
shared_free: dv("shared_free", ~[T_ptr(T_i8())]),
8484
mark: d("mark", ~[T_ptr(T_i8())], T_int()),
8585
new_str: d("new_str", ~[T_ptr(T_i8()), T_size_t()], T_ptr(T_str())),
86-
vec_append:
87-
d("vec_append",
86+
evec_append:
87+
d("evec_append",
8888
~[T_ptr(tydesc_type), T_ptr(tydesc_type),
8989
T_ptr(T_opaque_vec_ptr()), T_opaque_vec_ptr(), T_bool()],
9090
T_void()),

src/comp/middle/trans.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,8 @@ fn trans_compare(cx: &@block_ctxt, op: ast::binop,
25422542
}
25432543
}
25442544

2545-
fn trans_vec_append(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef)
2545+
fn trans_evec_append(cx: &@block_ctxt, t: &ty::t,
2546+
lhs: ValueRef, rhs: ValueRef)
25462547
-> result {
25472548
let elt_ty = ty::sequence_element_type(bcx_tcx(cx), t);
25482549
let skip_null = C_bool(false);
@@ -2563,7 +2564,7 @@ fn trans_vec_append(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef)
25632564
let dst = bcx.build.PointerCast(lhs, T_ptr(T_opaque_vec_ptr()));
25642565
let src = bcx.build.PointerCast(rhs, T_opaque_vec_ptr());
25652566
ret rslt(bcx,
2566-
bcx.build.Call(bcx_ccx(cx).upcalls.vec_append,
2567+
bcx.build.Call(bcx_ccx(cx).upcalls.evec_append,
25672568
~[cx.fcx.lltaskptr, llvec_tydesc.val,
25682569
llelt_tydesc.val, dst, src, skip_null]));
25692570
}
@@ -3170,12 +3171,13 @@ mod ivec {
31703171
}
31713172
}
31723173

3173-
fn trans_vec_add(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef) ->
3174+
fn trans_evec_add(cx: &@block_ctxt, t: &ty::t,
3175+
lhs: ValueRef, rhs: ValueRef) ->
31743176
result {
31753177
let r = alloc_ty(cx, t);
31763178
let tmp = r.val;
31773179
r = copy_val(r.bcx, INIT, tmp, lhs, t);
3178-
let bcx = trans_vec_append(r.bcx, t, tmp, rhs).bcx;
3180+
let bcx = trans_evec_append(r.bcx, t, tmp, rhs).bcx;
31793181
tmp = load_if_immediate(bcx, tmp, t);
31803182
add_clean_temp(cx, tmp, t);
31813183
ret rslt(bcx, tmp);
@@ -3209,7 +3211,7 @@ fn trans_eager_binop(cx: &@block_ctxt, op: ast::binop, lhs: ValueRef,
32093211
if ty::sequence_is_interior(bcx_tcx(cx), intype) {
32103212
ret ivec::trans_add(cx, intype, lhs, rhs);
32113213
}
3212-
ret trans_vec_add(cx, intype, lhs, rhs);
3214+
ret trans_evec_add(cx, intype, lhs, rhs);
32133215
}
32143216
if is_float {
32153217
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) ->
50285030
ret ivec::trans_append(rhs_res.bcx, t, lhs_res.res.val,
50295031
rhs_res.val);
50305032
}
5031-
ret trans_vec_append(rhs_res.bcx, t, lhs_res.res.val,
5033+
ret trans_evec_append(rhs_res.bcx, t, lhs_res.res.val,
50325034
rhs_res.val);
50335035
}
50345036
_ { }

src/rt/rust_upcall.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ copy_elements(rust_task *task, type_desc *elem_t,
308308
}
309309

310310
extern "C" CDECL void
311-
upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
312-
rust_vec **dst_ptr, rust_vec *src, bool skip_null)
311+
upcall_evec_append(rust_task *task, type_desc *t, type_desc *elem_t,
312+
rust_vec **dst_ptr, rust_vec *src, bool skip_null)
313313
{
314314
LOG_UPCALL_ENTRY(task);
315315
rust_vec *dst = *dst_ptr;
@@ -338,6 +338,12 @@ upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
338338
*dst_ptr = new_vec;
339339
}
340340

341+
// FIXME: Transitional. Please remove.
342+
extern "C" CDECL void
343+
upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
344+
rust_vec **dst_ptr, rust_vec *src, bool skip_null) {
345+
upcall_evec_append(task, t, elem_t, dst_ptr, src, skip_null);
346+
}
341347

342348
extern "C" CDECL type_desc *
343349
upcall_get_type_desc(rust_task *task,

src/rt/rustrt.def.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,6 @@ upcall_new_str
102102
upcall_shared_malloc
103103
upcall_shared_free
104104
upcall_sleep
105+
upcall_evec_append
105106
upcall_vec_append
106107
upcall_yield

0 commit comments

Comments
 (0)