Skip to content

Commit 868eb99

Browse files
committed
---
yaml --- r: 3346 b: refs/heads/master c: afa6321 h: refs/heads/master v: v3
1 parent 3657119 commit 868eb99

File tree

4 files changed

+90
-174
lines changed

4 files changed

+90
-174
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: 7432017d5ef4c2adc611bfd8efc6055902a25e4c
2+
refs/heads/master: afa632124f149b190ff3fb0a625a6a162637d82c

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -436,22 +436,8 @@ fn set_postcond_false(&crate_ctxt ccx, node_id id) {
436436
}
437437

438438
fn pure_exp(&crate_ctxt ccx, node_id id, &prestate p) -> bool {
439-
auto changed = false;
440-
changed = extend_prestate_ann(ccx, id, p) || changed;
441-
changed = extend_poststate_ann(ccx, id, p) || changed;
442-
ret changed;
443-
}
444-
445-
fn fixed_point_states(&fn_ctxt fcx, fn(&fn_ctxt, &_fn) -> bool f,
446-
&_fn start) {
447-
auto changed = f(fcx, start);
448-
if (changed) {
449-
ret fixed_point_states(fcx, f, start);
450-
} else {
451-
// we're done!
452-
453-
ret;
454-
}
439+
ret extend_prestate_ann(ccx, id, p) |
440+
extend_poststate_ann(ccx, id, p);
455441
}
456442

457443
fn num_constraints(fn_info m) -> uint { ret m.num_constraints; }
@@ -733,7 +719,7 @@ fn forget_in_poststate(&fn_ctxt fcx, &poststate p, node_id dead_v) -> bool {
733719
case (some(?d_id)) {
734720
for (norm_constraint c in constraints(fcx)) {
735721
if (constraint_mentions(fcx, c, d_id)) {
736-
changed = clear_in_poststate_(c.bit_num, p) || changed;
722+
changed |= clear_in_poststate_(c.bit_num, p);
737723
}
738724
}
739725
}
@@ -752,7 +738,7 @@ fn forget_in_poststate_still_init(&fn_ctxt fcx, &poststate p, node_id dead_v)
752738
case (some(?d_id)) {
753739
for (norm_constraint c in constraints(fcx)) {
754740
if (non_init_constraint_mentions(fcx, c, d_id)) {
755-
changed = clear_in_poststate_(c.bit_num, p) || changed;
741+
changed |= clear_in_poststate_(c.bit_num, p);
756742
}
757743
}
758744
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import aux::expr_poststate;
5151
import aux::stmt_poststate;
5252
import aux::stmt_to_ann;
5353
import aux::num_constraints;
54-
import aux::fixed_point_states;
5554
import aux::tritv_to_str;
5655
import aux::first_difference_string;
5756
import pretty::pprust::ty_to_str;
@@ -176,8 +175,9 @@ fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, node_id id,
176175
fn check_fn_states(&fn_ctxt fcx, &_fn f, node_id id, &span sp, &fn_ident i) {
177176
/* Compute the pre- and post-states for this function */
178177

179-
auto g = find_pre_post_state_fn;
180-
fixed_point_states(fcx, g, f);
178+
// Fixpoint iteration
179+
while (find_pre_post_state_fn(fcx, f)) {}
180+
181181
/* Now compare each expr's pre-state to its precondition
182182
and post-state to its postcondition */
183183

0 commit comments

Comments
 (0)