diff --git a/src/util/loopUnrolling.ml b/src/util/loopUnrolling.ml index 905cc39e6a..879e5e970b 100644 --- a/src/util/loopUnrolling.ml +++ b/src/util/loopUnrolling.ml @@ -31,34 +31,25 @@ class checkNoBreakVisitor = object end -let checkNoBreakStmt stmt = - let visitor = new checkNoBreakVisitor in - ignore @@ visitCilStmt visitor stmt - -let checkNoBreakBlock block = - let visitor = new checkNoBreakVisitor in - ignore @@ visitCilBlock visitor block - class findBreakVisitor(compOption: exp option ref) = object inherit nopCilVisitor method! vstmt stmt = match stmt.skind with | Block _ -> DoChildren - | Break _ -> raise WrongOrMultiple + | Break _ -> SkipChildren | If (cond, t, e, _, _) -> ( - checkNoBreakBlock t; match e.bstmts with | [s] -> ( match s.skind with | Break _ -> ( match !compOption with - | Some _ -> raise WrongOrMultiple (*more than one loop break*) + | Some _ -> SkipChildren (*more than one loop break*) | _ -> compOption := Some cond; SkipChildren ) - | _ -> checkNoBreakStmt stmt; SkipChildren + | _ -> SkipChildren ) - | _ -> checkNoBreakStmt stmt; SkipChildren + | _ -> SkipChildren ) | _ -> SkipChildren