Skip to content

Commit 35cea1d

Browse files
committed
No need to match and unroll comparison operator type in LoopUnrolling
It should always be int.
1 parent 95e136b commit 35cea1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util/loopUnrolling.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ let containsInstructions stmt =
135135

136136
let isCompare = function
137137
| Lt | Gt | Le | Ge | Ne -> true (*an loop that test for equality can not be of the type we look for*)
138+
(* TODO: why not Eq? *)
138139
| _ -> false
139140

140141
let loopBody loopStatement = match loopStatement.skind with
@@ -260,8 +261,8 @@ let findLoopVarAndGoal loopStatement func (op, exp1, exp2) =
260261
end;
261262
| _ -> None
262263

263-
let getLoopVar loopStatement func = function (* TODO: unrolltype? *)
264-
| BinOp (op, exp1, exp2, TInt _) when isCompare op -> findLoopVarAndGoal loopStatement func (op, exp1, exp2)
264+
let getLoopVar loopStatement func = function
265+
| BinOp (op, exp1, exp2, _) when isCompare op -> findLoopVarAndGoal loopStatement func (op, exp1, exp2)
265266
| _ -> None
266267

267268
let getsPointedAt var func =

0 commit comments

Comments
 (0)