Skip to content

Commit 6f833d3

Browse files
committed
Remove restriction that no loop unrolling is done when breaks are in the loop
1 parent bb6f9aa commit 6f833d3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/util/loopUnrolling.ml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,19 @@ class findBreakVisitor(compOption: exp option ref) = object
4545
method! vstmt stmt =
4646
match stmt.skind with
4747
| Block _ -> DoChildren
48-
| Break _ -> raise WrongOrMultiple
48+
| Break _ -> SkipChildren
4949
| If (cond, t, e, _, _) -> (
50-
checkNoBreakBlock t;
5150
match e.bstmts with
5251
| [s] -> (
5352
match s.skind with
5453
| Break _ -> (
5554
match !compOption with
56-
| Some _ -> raise WrongOrMultiple (*more than one loop break*)
55+
| Some _ -> SkipChildren (*more than one loop break*)
5756
| _ -> compOption := Some cond; SkipChildren
5857
)
59-
| _ -> checkNoBreakStmt stmt; SkipChildren
58+
| _ -> SkipChildren
6059
)
61-
| _ -> checkNoBreakStmt stmt; SkipChildren
60+
| _ -> SkipChildren
6261
)
6362
| _ -> SkipChildren
6463

0 commit comments

Comments
 (0)