Taddeus Kroes il y a 11 ans
Parent
commit
e7590e6e49
1 fichiers modifiés avec 4 ajouts et 6 suppressions
  1. 4 6
      phases/unroll.ml

+ 4 - 6
phases/unroll.ml

@@ -35,17 +35,15 @@ let rec unroll_body counters = function
   (*
    * Look for the following pattern:
    * i = 0;
-   * while (a < stop) {
+   * while (i < stop) {
    *   <body>;
-   *   b = c + step;
+   *   i = i + step;
    * }
-   * where a = b = c = i and start, stop, step are integer constants and i is a
-   * generated variable
+   * where start, stop, step are integer constants and i is a generated variable
    *)
   | (VarLet (VarDec (Int, i, None, _), None, Const (IntVal start, _), _) as init) ::
     (While (
-      Binop (
-        Lt,
+      Binop (Lt,
         VarUse (VarDec (Int, comp, None, _), None, _),
         Const (IntVal stop, _),
       _),