-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove restriction that no loop unrolling is done when breaks are in the loop #1518
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this visitor now, I understand why it didn't want multiple Now, if there are multiple matching |
||
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 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkNoBreakVisitor
itself is also unused now.