@@ -160,16 +160,6 @@ import util::common::has_nonlocal_exits;
160
160
import util:: common:: log_stmt;
161
161
import util:: common:: log_expr_err;
162
162
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
-
173
163
fn seq_states ( & fn_ctxt fcx, prestate pres, vec[ @expr] exprs )
174
164
-> tup ( bool , poststate ) {
175
165
auto changed = false ;
@@ -655,8 +645,9 @@ fn find_pre_post_state_stmt(&fn_ctxt fcx, &prestate pres, @stmt s) -> bool {
655
645
|| changed;
656
646
changed = extend_poststate(stmt_ann.states.poststate,
657
647
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
+ }
660
651
}
661
652
}
662
653
case ( stmt_expr ( ?e, _) ) {
@@ -742,57 +733,11 @@ fn find_pre_post_state_block(&fn_ctxt fcx, &prestate pres0, &block b)
742
733
}
743
734
744
735
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? */
747
736
auto num_local_vars = num_locals ( fcx. enclosing ) ;
748
737
ret find_pre_post_state_block ( fcx,
749
738
empty_prestate ( num_local_vars) , f. body ) ;
750
739
}
751
740
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
- }
796
741
//
797
742
// Local Variables:
798
743
// mode: rust
0 commit comments