Skip to content

Commit 57bf474

Browse files
committed
---
yaml --- r: 4429 b: refs/heads/master c: 59e9b62 h: refs/heads/master i: 4427: 2d61a0d v: v3
1 parent 2021b45 commit 57bf474

File tree

18 files changed

+87
-105
lines changed

18 files changed

+87
-105
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9b9170f9fe2e4701255a5bd0630c203409d8e934
2+
refs/heads/master: 59e9b629c042e9417e5ac662cbf21c0205e765c7

trunk/src/comp/front/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn fold_mod(cx: &test_ctxt, m: &ast::_mod, fld: fold::ast_fold) -> ast::_mod {
5959
// we want to be main.
6060
fn nomain(item: &@ast::item) -> option::t[@ast::item] {
6161
alt item.node {
62-
ast::item_fn(f, _, _) {
62+
ast::item_fn(f, _) {
6363
if item.ident == "main" {
6464
option::none
6565
} else { option::some(item) }
@@ -107,7 +107,7 @@ fn is_test_fn(i: &@ast::item) -> bool {
107107

108108
fn has_test_signature(i: &@ast::item) -> bool {
109109
alt i.node {
110-
ast::item_fn(f, tps, _) {
110+
ast::item_fn(f, tps) {
111111
let input_cnt = ivec::len(f.decl.inputs);
112112
let no_output = f.decl.output.node == ast::ty_nil;
113113
let tparm_cnt = ivec::len(tps);
@@ -191,7 +191,7 @@ fn mk_tests(cx: &test_ctxt) -> @ast::item {
191191

192192
let fn_ = {decl: decl, proto: proto, body: body};
193193

194-
let item_ = ast::item_fn(fn_, ~[], ast::il_normal);
194+
let item_ = ast::item_fn(fn_, ~[]);
195195
let item: ast::item =
196196
{ident: "tests",
197197
attrs: ~[],
@@ -309,7 +309,7 @@ fn mk_main(cx: &test_ctxt) -> @ast::item {
309309

310310
let fn_ = {decl: decl, proto: proto, body: body};
311311

312-
let item_ = ast::item_fn(fn_, ~[], ast::il_normal);
312+
let item_ = ast::item_fn(fn_, ~[]);
313313
let item: ast::item =
314314
{ident: "main",
315315
attrs: ~[],

trunk/src/comp/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn encode_module_item_paths(ebml_w: &ebmlivec::writer, module: &_mod,
8181
encode_def_id(ebml_w, local_def(it.id));
8282
ebmlivec::end_tag(ebml_w);
8383
}
84-
item_fn(_, tps, _) {
84+
item_fn(_, tps) {
8585
add_to_index(ebml_w, path, index, it.ident);
8686
ebmlivec::start_tag(ebml_w, tag_paths_data_item);
8787
encode_name(ebml_w, it.ident);
@@ -250,7 +250,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebmlivec::writer,
250250
encode_symbol(ecx, ebml_w, item.id);
251251
ebmlivec::end_tag(ebml_w);
252252
}
253-
item_fn(fd, tps, _) {
253+
item_fn(fd, tps) {
254254
ebmlivec::start_tag(ebml_w, tag_items_data_item);
255255
encode_def_id(ebml_w, local_def(item.id));
256256
encode_family(ebml_w,

trunk/src/comp/middle/alias.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import ast::ident;
44
import ast::fn_ident;
55
import ast::node_id;
66
import ast::def_id;
7-
import ast::inlineness;
87
import syntax::codemap::span;
98
import syntax::visit;
109
import visit::vt;
@@ -43,7 +42,7 @@ fn check_crate(tcx: ty::ctxt, crate: &@ast::crate) {
4342
// Stores information about object fields and function
4443
// arguments that's otherwise not easily available.
4544
let cx = @{tcx: tcx, local_map: std::map::new_int_hash()};
46-
let v = @{visit_fn: bind visit_fn(cx, _, _, _, _, _, _, _, _),
45+
let v = @{visit_fn: bind visit_fn(cx, _, _, _, _, _, _, _),
4746
visit_item: bind visit_item(cx, _, _, _),
4847
visit_expr: bind visit_expr(cx, _, _, _),
4948
visit_decl: bind visit_decl(cx, _, _, _)
@@ -52,9 +51,8 @@ fn check_crate(tcx: ty::ctxt, crate: &@ast::crate) {
5251
tcx.sess.abort_if_errors();
5352
}
5453

55-
fn visit_fn(cx: &@ctx, f: &ast::_fn, tp: &ast::ty_param[], il: inlineness,
56-
sp: &span, name: &fn_ident, id: ast::node_id, sc: &scope,
57-
v: &vt[scope]) {
54+
fn visit_fn(cx: &@ctx, f: &ast::_fn, tp: &ast::ty_param[], sp: &span,
55+
name: &fn_ident, id: ast::node_id, sc: &scope, v: &vt[scope]) {
5856
visit::visit_fn_decl(f.decl, sc, v);
5957
for arg_: ast::arg in f.decl.inputs {
6058
cx.local_map.insert(arg_.id, arg(arg_.mode));

trunk/src/comp/middle/freevars.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import std::option;
88
import std::int;
99
import std::option::*;
1010
import syntax::ast;
11-
import syntax::ast::inlineness;
1211
import syntax::visit;
1312
import driver::session;
1413
import middle::resolve;
@@ -46,8 +45,8 @@ fn collect_freevars(def_map: &resolve::def_map, sess: &session::session,
4645
for decl: ast::node_id in initial_decls { set_add(decls, decl); }
4746
let refs = @mutable ~[];
4847

49-
let walk_fn = lambda(f: &ast::_fn, tps: &ast::ty_param[], il: inlineness,
50-
sp: &span, i: &ast::fn_ident, nid: ast::node_id) {
48+
let walk_fn = lambda(f: &ast::_fn, tps: &ast::ty_param[], sp: &span,
49+
i: &ast::fn_ident, nid: ast::node_id) {
5150
for a: ast::arg in f.decl.inputs { set_add(decls, a.id); }
5251
};
5352
let walk_expr = lambda(expr: &@ast::expr) {
@@ -108,10 +107,10 @@ fn annotate_freevars(sess: &session::session, def_map: &resolve::def_map,
108107
crate: &@ast::crate) -> freevar_map {
109108
let freevars = new_int_hash();
110109

111-
let walk_fn = lambda(f: &ast::_fn, tps: &ast::ty_param[], il: inlineness,
112-
sp: &span, i: &ast::fn_ident, nid: ast::node_id) {
110+
let walk_fn = lambda(f: &ast::_fn, tps: &ast::ty_param[], sp: &span,
111+
i: &ast::fn_ident, nid: ast::node_id) {
113112
let start_walk = lambda(v: &visit::vt[()]) {
114-
v.visit_fn(f, tps, il, sp, i, nid, (), v);
113+
v.visit_fn(f, tps, sp, i, nid, (), v);
115114
};
116115
let vars = collect_freevars(def_map, sess, start_walk, ~[]);
117116
freevars.insert(nid, vars);

trunk/src/comp/middle/resolve.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import ast::def;
77
import ast::def_id;
88
import ast::node_id;
99
import ast::local_def;
10-
import ast::inlineness;
1110

1211
import metadata::csearch;
1312
import metadata::cstore;
@@ -260,7 +259,7 @@ fn resolve_names(e: &@env, c: &@ast::crate) {
260259
visit_expr: bind walk_expr(e, _, _, _),
261260
visit_ty: bind walk_ty(e, _, _, _),
262261
visit_constr: bind walk_constr(e, _, _, _, _, _),
263-
visit_fn: bind visit_fn_with_scope(e, _, _, _, _, _, _, _, _)
262+
visit_fn: bind visit_fn_with_scope(e, _, _, _, _, _, _, _)
264263
with *visit::default_visitor()};
265264
visit::visit_crate(*c, cons(scope_crate, @nil), visit::mk_vt(v));
266265
e.sess.abort_if_errors();
@@ -329,8 +328,8 @@ fn visit_native_item_with_scope(ni: &@ast::native_item, sc: &scopes,
329328
}
330329

331330
fn visit_fn_with_scope(e: &@env, f: &ast::_fn, tp: &ast::ty_param[],
332-
il: inlineness, sp: &span, name: &fn_ident,
333-
id: node_id, sc: &scopes, v: &vt[scopes]) {
331+
sp: &span, name: &fn_ident, id: node_id, sc: &scopes,
332+
v: &vt[scopes]) {
334333
// is this a main fn declaration?
335334
alt name {
336335
some(nm) {
@@ -349,7 +348,7 @@ fn visit_fn_with_scope(e: &@env, f: &ast::_fn, tp: &ast::ty_param[],
349348
for c: @ast::constr in f.decl.constraints {
350349
resolve_constr(e, id, c, sc, v);
351350
}
352-
visit::visit_fn(f, tp, il, sp, name, id,
351+
visit::visit_fn(f, tp, sp, name, id,
353352
cons(scope_fn(f.decl, f.proto, tp), @sc), v);
354353
}
355354

@@ -825,7 +824,7 @@ fn found_def_item(i: &@ast::item, ns: namespace) -> option::t[def] {
825824
ast::item_const(_, _) {
826825
if ns == ns_value { ret some(ast::def_const(local_def(i.id))); }
827826
}
828-
ast::item_fn(f, _, _) {
827+
ast::item_fn(f, _) {
829828
if ns == ns_value {
830829
ret some(ast::def_fn(local_def(i.id), f.decl.purity));
831830
}
@@ -1083,7 +1082,7 @@ fn index_mod(md: &ast::_mod) -> mod_index {
10831082
}
10841083
for it: @ast::item in md.items {
10851084
alt it.node {
1086-
ast::item_const(_, _) | ast::item_fn(_, _, _) | ast::item_mod(_) |
1085+
ast::item_const(_, _) | ast::item_fn(_, _) | ast::item_mod(_) |
10871086
ast::item_native_mod(_) | ast::item_ty(_, _) |
10881087
ast::item_res(_, _, _, _) | ast::item_obj(_, _, _) {
10891088
add_to_index(index, it.ident, mie_item(it));
@@ -1219,7 +1218,7 @@ fn check_item(e: &@env, i: &@ast::item, x: &(), v: &vt[()]) {
12191218
}
12201219
visit::visit_item(i, x, v);
12211220
alt i.node {
1222-
ast::item_fn(f, ty_params, _) {
1221+
ast::item_fn(f, ty_params) {
12231222
check_fn(*e, i.span, f);
12241223
ensure_unique(*e, i.span, typaram_names(ty_params),
12251224
ident_id, "type parameter");
@@ -1303,7 +1302,7 @@ fn check_block(e: &@env, b: &ast::blk, x: &(), v: &vt[()]) {
13031302
ast::item_mod(_) | ast::item_native_mod(_) {
13041303
add_name(mods, it.span, it.ident);
13051304
}
1306-
ast::item_const(_, _) | ast::item_fn(_, _, _) {
1305+
ast::item_const(_, _) | ast::item_fn(_, _) {
13071306
add_name(values, it.span, it.ident);
13081307
}
13091308
ast::item_ty(_, _) { add_name(types, it.span, it.ident); }

trunk/src/comp/middle/trans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7329,7 +7329,7 @@ fn trans_const(cx: &@crate_ctxt, e: @ast::expr, id: ast::node_id) {
73297329

73307330
fn trans_item(cx: @local_ctxt, item: &ast::item) {
73317331
alt item.node {
7332-
ast::item_fn(f, tps, _) {
7332+
ast::item_fn(f, tps) {
73337333
let sub_cx = extend_path(cx, item.ident);
73347334
alt cx.ccx.item_ids.find(item.id) {
73357335
some(llfndecl) {
@@ -7740,7 +7740,7 @@ fn collect_item_2(ccx: &@crate_ctxt, i: &@ast::item, pt: &str[],
77407740
let new_pt = pt + item_path(i);
77417741
visit::visit_item(i, new_pt, v);
77427742
alt i.node {
7743-
ast::item_fn(f, tps, _) {
7743+
ast::item_fn(f, tps) {
77447744
if !ccx.obj_methods.contains_key(i.id) {
77457745
decl_fn_and_pair(ccx, i.span, new_pt, "fn", tps, i.id);
77467746
}

trunk/src/comp/middle/tstate/annotate.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ fn collect_ids_local(l: &@local, rs: @mutable node_id[]) {
4747
*rs += pat_binding_ids(l.node.pat);
4848
}
4949

50-
fn node_ids_in_fn(f: &_fn, tps: &ty_param[], il: inlineness, sp: &span,
51-
i: &fn_ident, id: node_id, rs: @mutable node_id[]) {
50+
fn node_ids_in_fn(f: &_fn, tps: &ty_param[], sp: &span, i: &fn_ident,
51+
id: node_id, rs: @mutable node_id[]) {
5252
let collect_ids =
5353
visit::mk_simple_visitor(@{visit_expr: bind collect_ids_expr(_, rs),
5454
visit_block: bind collect_ids_block(_, rs),
5555
visit_stmt: bind collect_ids_stmt(_, rs),
5656
visit_local: bind collect_ids_local(_, rs)
5757
with *visit::default_simple_visitor()});
58-
visit::visit_fn(f, tps, il, sp, i, id, (), collect_ids);
58+
visit::visit_fn(f, tps, sp, i, id, (), collect_ids);
5959
}
6060

6161
fn init_vecs(ccx: &crate_ctxt, node_ids: &node_id[], len: uint) {
@@ -66,25 +66,24 @@ fn init_vecs(ccx: &crate_ctxt, node_ids: &node_id[], len: uint) {
6666
}
6767

6868
fn visit_fn(ccx: &crate_ctxt, num_constraints: uint, f: &_fn,
69-
tps: &ty_param[], il: inlineness, sp: &span, i: &fn_ident,
70-
id: node_id) {
69+
tps: &ty_param[], sp: &span, i: &fn_ident, id: node_id) {
7170
let node_ids: @mutable node_id[] = @mutable ~[];
72-
node_ids_in_fn(f, tps, il, sp, i, id, node_ids);
71+
node_ids_in_fn(f, tps, sp, i, id, node_ids);
7372
let node_id_vec = *node_ids;
7473
init_vecs(ccx, node_id_vec, num_constraints);
7574
}
7675

77-
fn annotate_in_fn(ccx: &crate_ctxt, f: &_fn, tps: &ty_param[], il: inlineness,
78-
sp: &span, i: &fn_ident, id: node_id) {
76+
fn annotate_in_fn(ccx: &crate_ctxt, f: &_fn, tps: &ty_param[], sp: &span,
77+
i: &fn_ident, id: node_id) {
7978
let f_info = get_fn_info(ccx, id);
80-
visit_fn(ccx, num_constraints(f_info), f, tps, il, sp, i, id);
79+
visit_fn(ccx, num_constraints(f_info), f, tps, sp, i, id);
8180
}
8281

8382
fn annotate_crate(ccx: &crate_ctxt, crate: &crate) {
8483
let do_ann =
8584
visit::mk_simple_visitor(@{visit_fn:
86-
bind annotate_in_fn(ccx, _, _, _, _, _, _)
87-
with *visit::default_simple_visitor()});
85+
bind annotate_in_fn(ccx, _, _, _, _, _)
86+
with *visit::default_simple_visitor()});
8887
visit::visit_crate(crate, (), do_ann);
8988
}
9089
//

trunk/src/comp/middle/tstate/auxiliary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,8 @@ fn op_to_oper_ty(io: init_op) -> oper_type {
10511051
}
10521052

10531053
// default function visitor
1054-
fn do_nothing[T](f: &_fn, tp: &ty_param[], il: inlineness, sp: &span,
1055-
i: &fn_ident, iid: node_id, cx: &T, v: &visit::vt[T]) {
1054+
fn do_nothing[T](f: &_fn, tp: &ty_param[], sp: &span, i: &fn_ident,
1055+
iid: node_id, cx: &T, v: &visit::vt[T]) {
10561056
}
10571057

10581058

trunk/src/comp/middle/tstate/ck.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import ast::crate;
1717
import ast::return;
1818
import ast::noreturn;
1919
import ast::expr;
20-
import ast::inlineness;
2120
import syntax::visit;
2221
import syntax::codemap::span;
2322
import middle::ty::type_is_nil;
@@ -126,8 +125,8 @@ fn check_states_stmt(s: &@stmt, fcx: &fn_ctxt, v: &visit::vt[fn_ctxt]) {
126125
}
127126

128127
fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
129-
tps: &ast::ty_param[], il: inlineness,
130-
id: node_id, sp: &span, i: &fn_ident) {
128+
tps: &ast::ty_param[], id: node_id,
129+
sp: &span, i: &fn_ident) {
131130
/* Postorder traversal instead of pre is important
132131
because we want the smallest possible erroneous statement
133132
or expression. */
@@ -138,7 +137,7 @@ fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
138137
@{visit_stmt: check_states_stmt,
139138
visit_expr: check_states_expr,
140139
visit_fn: do_nothing with *visitor};
141-
visit::visit_fn(f, tps, il, sp, i, id, fcx, visit::mk_vt(visitor));
140+
visit::visit_fn(f, tps, sp, i, id, fcx, visit::mk_vt(visitor));
142141

143142
/* Check that the return value is initialized */
144143
let post = aux::block_poststate(fcx.ccx, f.body);
@@ -171,8 +170,8 @@ fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
171170
check_unused_vars(fcx);
172171
}
173172

174-
fn check_fn_states(fcx: &fn_ctxt, f: &_fn, tps: &ast::ty_param[],
175-
il: inlineness, id: node_id, sp: &span, i: &fn_ident) {
173+
fn check_fn_states(fcx: &fn_ctxt, f: &_fn, tps: &ast::ty_param[], id: node_id,
174+
sp: &span, i: &fn_ident) {
176175
/* Compute the pre- and post-states for this function */
177176

178177
// Fixpoint iteration
@@ -181,20 +180,19 @@ fn check_fn_states(fcx: &fn_ctxt, f: &_fn, tps: &ast::ty_param[],
181180
/* Now compare each expr's pre-state to its precondition
182181
and post-state to its postcondition */
183182

184-
check_states_against_conditions(fcx, f, tps, il, id, sp, i);
183+
check_states_against_conditions(fcx, f, tps, id, sp, i);
185184
}
186185

187-
fn fn_states(f: &_fn, tps: &ast::ty_param[], il: inlineness, sp: &span,
188-
i: &fn_ident, id: node_id, ccx: &crate_ctxt,
189-
v: &visit::vt[crate_ctxt]) {
190-
visit::visit_fn(f, tps, il, sp, i, id, ccx, v);
186+
fn fn_states(f: &_fn, tps: &ast::ty_param[], sp: &span, i: &fn_ident,
187+
id: node_id, ccx: &crate_ctxt, v: &visit::vt[crate_ctxt]) {
188+
visit::visit_fn(f, tps, sp, i, id, ccx, v);
191189
/* Look up the var-to-bit-num map for this function */
192190

193191
assert (ccx.fm.contains_key(id));
194192
let f_info = ccx.fm.get(id);
195193
let name = option::from_maybe("anon", i);
196194
let fcx = {enclosing: f_info, id: id, name: name, ccx: ccx};
197-
check_fn_states(fcx, f, tps, il, id, sp, i);
195+
check_fn_states(fcx, f, tps, id, sp, i);
198196
}
199197

200198
fn check_crate(cx: ty::ctxt, crate: @crate) {

trunk/src/comp/middle/tstate/collect_locals.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ fn collect_pred(e: &@expr, cx: &ctxt, v: &visit::vt[ctxt]) {
4343
visit::visit_expr(e, cx, v);
4444
}
4545

46-
fn find_locals(tcx: &ty::ctxt, f: &_fn, tps: &ty_param[], il: inlineness,
47-
sp: &span, i: &fn_ident, id: node_id) -> ctxt {
46+
fn find_locals(tcx: &ty::ctxt, f: &_fn, tps: &ty_param[], sp: &span,
47+
i: &fn_ident, id: node_id) -> ctxt {
4848
let cx: ctxt = {cs: @mutable ~[], tcx: tcx};
4949
let visitor = visit::default_visitor[ctxt]();
5050

5151
visitor =
5252
@{visit_local: collect_local,
5353
visit_expr: collect_pred,
5454
visit_fn: do_nothing with *visitor};
55-
visit::visit_fn(f, tps, il, sp, i, id, cx, visit::mk_vt(visitor));
55+
visit::visit_fn(f, tps, sp, i, id, cx, visit::mk_vt(visitor));
5656
ret cx;
5757
}
5858

@@ -88,13 +88,13 @@ fn add_constraint(tcx: &ty::ctxt, c: sp_constr, next: uint, tbl: constr_map)
8888

8989
/* builds a table mapping each local var defined in f
9090
to a bit number in the precondition/postcondition vectors */
91-
fn mk_fn_info(ccx: &crate_ctxt, f: &_fn, tp: &ty_param[], il: inlineness,
92-
f_sp: &span, f_name: &fn_ident, id: node_id) {
91+
fn mk_fn_info(ccx: &crate_ctxt, f: &_fn, tp: &ty_param[], f_sp: &span,
92+
f_name: &fn_ident, id: node_id) {
9393
let name = fn_ident_to_string(id, f_name);
9494
let res_map = @new_def_hash[constraint]();
9595
let next: uint = 0u;
9696

97-
let cx: ctxt = find_locals(ccx.tcx, f, tp, il, f_sp, f_name, id);
97+
let cx: ctxt = find_locals(ccx.tcx, f, tp, f_sp, f_name, id);
9898
/* now we have to add bit nums for both the constraints
9999
and the variables... */
100100

@@ -144,7 +144,7 @@ fn mk_fn_info(ccx: &crate_ctxt, f: &_fn, tp: &ty_param[], il: inlineness,
144144
fn mk_f_to_fn_info(ccx: &crate_ctxt, c: @crate) {
145145
let visitor =
146146
visit::mk_simple_visitor(@{visit_fn:
147-
bind mk_fn_info(ccx, _, _, _, _, _, _)
147+
bind mk_fn_info(ccx, _, _, _, _, _)
148148
with *visit::default_simple_visitor()});
149149
visit::visit_crate(*c, (), visitor);
150150
}

0 commit comments

Comments
 (0)