Skip to content

Commit 862bc52

Browse files
author
Eric Holk
committed
Removing tasks, ports and chans from the compiler.
1 parent f05a91a commit 862bc52

File tree

15 files changed

+7
-341
lines changed

15 files changed

+7
-341
lines changed

src/comp/metadata/tydecode.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
219219
'*' { ret ty::mk_ptr(st.tcx, parse_mt(st, sd)); }
220220
'V' { ret ty::mk_vec(st.tcx, parse_mt(st, sd)); }
221221
'I' { ret ty::mk_ivec(st.tcx, parse_mt(st, sd)); }
222-
'a' { ret ty::mk_task(st.tcx); }
223-
'P' { ret ty::mk_port(st.tcx, parse_ty(st, sd)); }
224-
'C' { ret ty::mk_chan(st.tcx, parse_ty(st, sd)); }
225222
'R' {
226223
assert (next(st) as char == '[');
227224
let fields: [ty::field] = ~[];

src/comp/metadata/tyencode.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
130130
ty::ty_ptr(mt) { w.write_char('*'); enc_mt(w, cx, mt); }
131131
ty::ty_vec(mt) { w.write_char('V'); enc_mt(w, cx, mt); }
132132
ty::ty_ivec(mt) { w.write_char('I'); enc_mt(w, cx, mt); }
133-
ty::ty_port(t) { w.write_char('P'); enc_ty(w, cx, t); }
134-
ty::ty_chan(t) { w.write_char('C'); enc_ty(w, cx, t); }
135133
ty::ty_rec(fields) {
136134
w.write_str("R[");
137135
for field: ty::field in fields {
@@ -188,7 +186,6 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
188186
w.write_str(uint::str(id));
189187
}
190188
ty::ty_type. { w.write_char('Y'); }
191-
ty::ty_task. { w.write_char('a'); }
192189
ty::ty_constr(ty, cs) {
193190
w.write_str("A[");
194191
enc_ty(w, cx, ty);

src/comp/middle/gc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ fn type_is_gc_relevant(cx: &ty::ctxt, ty: &ty::t) -> bool {
3535
ty::ty_nil. | ty::ty_bot. | ty::ty_bool. | ty::ty_int. |
3636
ty::ty_float. | ty::ty_uint. | ty::ty_machine(_) | ty::ty_char. |
3737
ty::ty_istr. | ty::ty_type. | ty::ty_native(_) | ty::ty_ptr(_) |
38-
ty::ty_port(_) | ty::ty_chan(_) | ty::ty_task. | ty::ty_type. |
39-
ty::ty_native(_) {
38+
ty::ty_type. | ty::ty_native(_) {
4039
ret false;
4140
}
4241

src/comp/middle/shape.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,6 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
357357
add_size_hint(ccx, s, mt.ty);
358358
add_substr(s, shape_of(ccx, mt.ty));
359359
}
360-
ty::ty_port(t) {
361-
s += ~[shape_port];
362-
add_substr(s, shape_of(ccx, t));
363-
}
364-
ty::ty_chan(t) { s += ~[shape_chan]; }
365-
ty::ty_task. { s += ~[shape_task]; }
366-
367360
ty::ty_rec(fields) {
368361
s += ~[shape_struct];
369362
let sub = ~[];

src/comp/middle/trans.rs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
220220
} else { llty = T_ivec(type_of_inner(cx, sp, mt.ty)); }
221221
}
222222
ty::ty_ptr(mt) { llty = T_ptr(type_of_inner(cx, sp, mt.ty)); }
223-
ty::ty_port(t) { llty = T_ptr(T_port(type_of_inner(cx, sp, t))); }
224-
ty::ty_chan(t) { llty = T_ptr(T_chan(type_of_inner(cx, sp, t))); }
225-
ty::ty_task. { llty = T_taskptr(*cx); }
226223
ty::ty_rec(fields) {
227224
let tys: [TypeRef] = ~[];
228225
for f: ty::field in fields {
@@ -1255,18 +1252,7 @@ fn make_copy_glue(cx: &@block_ctxt, v: ValueRef, t: &ty::t) {
12551252

12561253
let bcx;
12571254

1258-
if ty::type_is_task(bcx_tcx(cx), t) {
1259-
let task_ptr = cx.build.Load(v);
1260-
cx.build.Call(bcx_ccx(cx).upcalls.take_task,
1261-
~[cx.fcx.lltaskptr, task_ptr]);
1262-
bcx = cx;
1263-
} else if ty::type_is_chan(bcx_tcx(cx), t) {
1264-
let ptr = cx.build.Load(v);
1265-
ptr = cx.build.PointerCast(ptr, T_opaque_chan_ptr());
1266-
cx.build.Call(bcx_ccx(cx).upcalls.take_chan,
1267-
~[cx.fcx.lltaskptr, ptr]);
1268-
bcx = cx;
1269-
} else if ty::type_is_boxed(bcx_tcx(cx), t) {
1255+
if ty::type_is_boxed(bcx_tcx(cx), t) {
12701256
bcx = incr_refcnt_of_boxed(cx, cx.build.Load(v)).bcx;
12711257
} else if (ty::type_is_structural(bcx_tcx(cx), t)) {
12721258
bcx = duplicate_heap_parts_if_necessary(cx, v, t).bcx;
@@ -1342,21 +1328,6 @@ fn make_free_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
13421328
ty::ty_uniq(_) {
13431329
fail "free uniq unimplemented";
13441330
}
1345-
ty::ty_port(_) {
1346-
let v = cx.build.Load(v0);
1347-
cx.build.Call(bcx_ccx(cx).upcalls.del_port,
1348-
~[cx.fcx.lltaskptr,
1349-
cx.build.PointerCast(v, T_opaque_port_ptr())]);
1350-
rslt(cx, C_int(0))
1351-
}
1352-
ty::ty_chan(_) {
1353-
let v = cx.build.Load(v0);
1354-
cx.build.Call(bcx_ccx(cx).upcalls.del_chan,
1355-
~[cx.fcx.lltaskptr,
1356-
cx.build.PointerCast(v, T_opaque_chan_ptr())]);
1357-
rslt(cx, C_int(0))
1358-
}
1359-
ty::ty_task. { rslt(cx, C_nil()) }
13601331
ty::ty_obj(_) {
13611332
let box_cell =
13621333
cx.build.GEP(v0, ~[C_int(0), C_int(abi::obj_field_box)]);
@@ -1450,20 +1421,6 @@ fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
14501421
}
14511422
ty::ty_box(_) { decr_refcnt_maybe_free(cx, v0, v0, t) }
14521423
ty::ty_uniq(_) { fail "drop uniq unimplemented"; }
1453-
ty::ty_port(_) { decr_refcnt_maybe_free(cx, v0, v0, t) }
1454-
ty::ty_chan(_) {
1455-
let ptr = cx.build.Load(v0);
1456-
ptr = cx.build.PointerCast(ptr, T_opaque_chan_ptr());
1457-
{bcx: cx,
1458-
val: cx.build.Call(bcx_ccx(cx).upcalls.drop_chan,
1459-
~[cx.fcx.lltaskptr, ptr])}
1460-
}
1461-
ty::ty_task. {
1462-
let task_ptr = cx.build.Load(v0);
1463-
{bcx: cx,
1464-
val: cx.build.Call(bcx_ccx(cx).upcalls.drop_task,
1465-
~[cx.fcx.lltaskptr, task_ptr])}
1466-
}
14671424
ty::ty_obj(_) {
14681425
let box_cell =
14691426
cx.build.GEP(v0, ~[C_int(0), C_int(abi::obj_field_box)]);

src/comp/middle/tstate/pre_post_conditions.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,6 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
356356
_ { }
357357
}
358358
}
359-
expr_spawn(_, _, operator, operands) {
360-
let /* copy */args = operands;
361-
args += ~[operator];
362-
find_pre_post_exprs(fcx, args, e.id);
363-
forget_args_moved_in(fcx, e, callee_modes(fcx, operator.id),
364-
operands);
365-
}
366359
expr_vec(args, _, _) { find_pre_post_exprs(fcx, args, e.id); }
367360
expr_path(p) {
368361
let rslt = expr_pp(fcx.ccx, e);
@@ -374,10 +367,6 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
374367
find_pre_post_expr(fcx, arg);
375368
copy_pre_post(fcx.ccx, e.id, arg);
376369
}
377-
expr_chan(arg) {
378-
find_pre_post_expr(fcx, arg);
379-
copy_pre_post(fcx.ccx, e.id, arg);
380-
}
381370
expr_put(opt) {
382371
alt opt {
383372
some(arg) {
@@ -413,10 +402,6 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
413402
expr_move(lhs, rhs) { handle_update(fcx, e, lhs, rhs, oper_move); }
414403
expr_swap(lhs, rhs) { handle_update(fcx, e, lhs, rhs, oper_swap); }
415404
expr_assign(lhs, rhs) { handle_update(fcx, e, lhs, rhs, oper_assign); }
416-
expr_recv(lhs, rhs) {
417-
// note inversion of lhs and rhs
418-
handle_update(fcx, e, rhs, lhs, oper_assign);
419-
}
420405
expr_assign_op(_, lhs, rhs) {
421406
/* Different from expr_assign in that the lhs *must*
422407
already be initialized */
@@ -460,7 +445,6 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
460445
expr_postcond(fcx.ccx, l));
461446
} else { find_pre_post_exprs(fcx, ~[l, r], e.id); }
462447
}
463-
expr_send(l, r) { find_pre_post_exprs(fcx, ~[l, r], e.id); }
464448
expr_unary(_, operand) {
465449
find_pre_post_expr(fcx, operand);
466450
copy_pre_post(fcx.ccx, e.id, operand);
@@ -585,7 +569,6 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
585569
}
586570
expr_break. { clear_pp(expr_pp(fcx.ccx, e)); }
587571
expr_cont. { clear_pp(expr_pp(fcx.ccx, e)); }
588-
expr_port(_) { clear_pp(expr_pp(fcx.ccx, e)); }
589572
expr_mac(_) { fcx.ccx.tcx.sess.bug("unexpanded macro"); }
590573
expr_anon_obj(anon_obj) {
591574
alt anon_obj.inner_obj {

src/comp/middle/tstate/states.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,6 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
323323
operands,
324324
controlflow_expr(fcx.ccx, operator));
325325
}
326-
expr_spawn(_, _, operator, operands) {
327-
ret find_pre_post_state_call(fcx, pres, operator, e.id,
328-
callee_arg_init_ops(fcx, operator.id),
329-
operands, return);
330-
}
331326
expr_bind(operator, maybe_args) {
332327
let args = ~[];
333328
let callee_ops = callee_arg_init_ops(fcx, operator.id);
@@ -350,9 +345,6 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
350345
expr_log(_, ex) {
351346
ret find_pre_post_state_sub(fcx, pres, ex, e.id, none);
352347
}
353-
expr_chan(ex) {
354-
ret find_pre_post_state_sub(fcx, pres, ex, e.id, none);
355-
}
356348
expr_mac(_) { fcx.ccx.tcx.sess.bug("unexpanded macro"); }
357349
expr_put(maybe_e) {
358350
alt maybe_e {
@@ -407,19 +399,6 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
407399
// Could be more precise and actually swap the role of
408400
// lhs and rhs in constraints
409401
}
410-
expr_recv(lhs, rhs) {
411-
// Opposite order as most other binary operations,
412-
// so not using find_pre_post_state_two
413-
let changed =
414-
set_prestate_ann(fcx.ccx, e.id, pres) |
415-
find_pre_post_state_expr(fcx, pres, lhs) |
416-
find_pre_post_state_expr(fcx, expr_poststate(fcx.ccx, lhs),
417-
rhs);
418-
let post = tritv_clone(expr_poststate(fcx.ccx, rhs));
419-
forget_in_poststate_still_init(fcx, post, rhs.id);
420-
gen_if_local(fcx, post, rhs);
421-
ret changed | set_poststate_ann(fcx.ccx, e.id, post);
422-
}
423402
expr_ret(maybe_ret_val) {
424403
let changed = set_prestate_ann(fcx.ccx, e.id, pres);
425404
/* normally, everything is true if execution continues after
@@ -467,9 +446,6 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
467446
ret find_pre_post_state_two(fcx, pres, l, r, e.id, oper_pure);
468447
}
469448
}
470-
expr_send(l, r) {
471-
ret find_pre_post_state_two(fcx, pres, l, r, e.id, oper_pure);
472-
}
473449
expr_assign_op(op, lhs, rhs) {
474450
ret find_pre_post_state_two(fcx, pres, lhs, rhs, e.id,
475451
oper_assign_op);
@@ -615,7 +591,6 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
615591
}
616592
expr_break. { ret pure_exp(fcx.ccx, e.id, pres); }
617593
expr_cont. { ret pure_exp(fcx.ccx, e.id, pres); }
618-
expr_port(_) { ret pure_exp(fcx.ccx, e.id, pres); }
619594
expr_self_method(_) { ret pure_exp(fcx.ccx, e.id, pres); }
620595
expr_anon_obj(anon_obj) {
621596
alt anon_obj.inner_obj {

0 commit comments

Comments
 (0)