diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-07-04 20:56:23 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-07-06 11:09:07 -0700 |
| commit | 702f88a3bee11d1a09541093280ef27a1453710b (patch) | |
| tree | 7ad68bd2ebcb3f811675a06d127b26f4846667d2 /src/comp | |
| parent | 4c384304e9c37590a2e65d4803b7abef375490a4 (diff) | |
rustc: Move tstate::annotate over to interior vectors
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/tstate/annotate.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/comp/middle/tstate/annotate.rs b/src/comp/middle/tstate/annotate.rs index 6f3b29716ec..b306eda5737 100644 --- a/src/comp/middle/tstate/annotate.rs +++ b/src/comp/middle/tstate/annotate.rs @@ -24,36 +24,36 @@ import aux::crate_ctxt; import aux::add_node; import middle::tstate::ann::empty_ann; -fn collect_ids_expr(&@expr e, @mutable vec[node_id] rs) { - vec::push(*rs, e.id); +fn collect_ids_expr(&@expr e, @mutable node_id[] rs) { + *rs += ~[e.id]; } -fn collect_ids_block(&block b, @mutable vec[node_id] rs) { - vec::push(*rs, b.node.id); +fn collect_ids_block(&block b, @mutable node_id[] rs) { + *rs += ~[b.node.id]; } -fn collect_ids_stmt(&@stmt s, @mutable vec[node_id] rs) { +fn collect_ids_stmt(&@stmt s, @mutable node_id[] rs) { alt (s.node) { case (stmt_decl(_, ?id)) { log "node_id " + int::str(id); log_stmt(*s); - vec::push(*rs, id); + *rs += ~[id]; } case (stmt_expr(_, ?id)) { log "node_id " + int::str(id); log_stmt(*s); - vec::push(*rs, id); + *rs += ~[id]; } case (_) { } } } -fn collect_ids_local(&@local l, @mutable vec[node_id] rs) { - vec::push(*rs, l.node.id); +fn collect_ids_local(&@local l, @mutable node_id[] rs) { + *rs += ~[l.node.id]; } fn node_ids_in_fn(&_fn f, &vec[ty_param] tps, &span sp, &fn_ident i, - node_id id, @mutable vec[node_id] rs) { + node_id id, @mutable node_id[] rs) { auto collect_ids = walk::default_visitor(); collect_ids = rec(visit_expr_pre=bind collect_ids_expr(_, rs), @@ -63,7 +63,7 @@ fn node_ids_in_fn(&_fn f, &vec[ty_param] tps, &span sp, &fn_ident i, walk::walk_fn(collect_ids, f, tps, sp, i, id); } -fn init_vecs(&crate_ctxt ccx, &vec[node_id] node_ids, uint len) { +fn init_vecs(&crate_ctxt ccx, &node_id[] node_ids, uint len) { for (node_id i in node_ids) { log int::str(i) + " |-> " + uint::str(len); add_node(ccx, i, empty_ann(len)); @@ -72,7 +72,7 @@ fn init_vecs(&crate_ctxt ccx, &vec[node_id] node_ids, uint len) { fn visit_fn(&crate_ctxt ccx, uint num_constraints, &_fn f, &vec[ty_param] tps, &span sp, &fn_ident i, node_id id) { - let @mutable vec[node_id] node_ids = @mutable []; + let @mutable node_id[] node_ids = @mutable ~[]; node_ids_in_fn(f, tps, sp, i, id, node_ids); auto node_id_vec = *node_ids; init_vecs(ccx, node_id_vec, num_constraints); |
