Skip to content

Commit e0133e6

Browse files
catamorphismgraydon
authored andcommitted
---
yaml --- r: 2646 b: refs/heads/master c: d60e08c h: refs/heads/master v: v3
1 parent ac4e613 commit e0133e6

File tree

2 files changed

+4
-59
lines changed

2 files changed

+4
-59
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: e1844d2719d1a6103f6662ec373f249fbdb953d3
2+
refs/heads/master: d60e08c18e25dd2699a67b59b6d29126f53a28c2

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

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,6 @@ import util::common::has_nonlocal_exits;
160160
import util::common::log_stmt;
161161
import util::common::log_expr_err;
162162

163-
fn find_pre_post_state_mod(&_mod m) -> bool {
164-
log("implement find_pre_post_state_mod!");
165-
fail;
166-
}
167-
168-
fn find_pre_post_state_native_mod(&native_mod m) -> bool {
169-
log("implement find_pre_post_state_native_mod!");
170-
fail;
171-
}
172-
173163
fn seq_states(&fn_ctxt fcx, prestate pres, vec[@expr] exprs)
174164
-> tup(bool, poststate) {
175165
auto changed = false;
@@ -655,8 +645,9 @@ fn find_pre_post_state_stmt(&fn_ctxt fcx, &prestate pres, @stmt s) -> bool {
655645
|| changed;
656646
changed = extend_poststate(stmt_ann.states.poststate,
657647
pres) || changed;
658-
ret (find_pre_post_state_item(fcx, an_item) || changed);
659-
}
648+
/* the outer "walk" will recurse into the item */
649+
ret changed;
650+
}
660651
}
661652
}
662653
case (stmt_expr(?e, _)) {
@@ -742,57 +733,11 @@ fn find_pre_post_state_block(&fn_ctxt fcx, &prestate pres0, &block b)
742733
}
743734

744735
fn find_pre_post_state_fn(&fn_ctxt fcx, &_fn f) -> bool {
745-
/* FIXME: where do we set args as being initialized?
746-
What about for methods? */
747736
auto num_local_vars = num_locals(fcx.enclosing);
748737
ret find_pre_post_state_block(fcx,
749738
empty_prestate(num_local_vars), f.body);
750739
}
751740

752-
fn find_pre_post_state_obj(crate_ctxt ccx, _obj o) -> bool {
753-
fn do_a_method(crate_ctxt ccx, &@method m) -> bool {
754-
assert (ccx.fm.contains_key(m.node.id));
755-
ret find_pre_post_state_fn(rec(enclosing=ccx.fm.get(m.node.id),
756-
id=m.node.id,
757-
name=m.node.ident,
758-
ccx=ccx),
759-
m.node.meth);
760-
}
761-
auto f = bind do_a_method(ccx,_);
762-
auto flags = vec::map[@method, bool](f, o.methods);
763-
auto changed = vec::or(flags);
764-
changed = changed || maybe[@method, bool](false, f, o.dtor);
765-
ret changed;
766-
}
767-
768-
fn find_pre_post_state_item(&fn_ctxt fcx, @item i) -> bool {
769-
alt (i.node) {
770-
case (item_const(?id, ?t, ?e, ?di, ?a)) {
771-
ret find_pre_post_state_expr(fcx,
772-
empty_prestate(num_locals(fcx.enclosing)), e);
773-
}
774-
case (item_fn(?id, ?f, ?ps, ?di, ?a)) {
775-
assert (fcx.ccx.fm.contains_key(di));
776-
ret find_pre_post_state_fn(rec(enclosing=fcx.ccx.fm.get(di),
777-
id=di, name=id with fcx), f);
778-
}
779-
case (item_mod(?id, ?m, ?di)) {
780-
ret find_pre_post_state_mod(m);
781-
}
782-
case (item_native_mod(?id, ?nm, ?di)) {
783-
ret find_pre_post_state_native_mod(nm);
784-
}
785-
case (item_ty(_,_,_,_,_)) {
786-
ret false;
787-
}
788-
case (item_tag(_,_,_,_,_)) {
789-
ret false;
790-
}
791-
case (item_obj(?id, ?o, ?ps, ?di, ?a)) {
792-
ret find_pre_post_state_obj(fcx.ccx, o);
793-
}
794-
}
795-
}
796741
//
797742
// Local Variables:
798743
// mode: rust

0 commit comments

Comments
 (0)