Ignore:
Timestamp:
Oct 17, 2011, 2:08:27 PM (9 years ago)
Author:
tranquil
Message:

fiddling with Cminor: elimination of loops, blocks and exits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorFold.ml

    r1334 r1392  
    3131
    3232let statement_subs = function
    33   | Cminor.St_skip | Cminor.St_exit _ | Cminor.St_return None
     33  | Cminor.St_skip | (*Cminor.St_exit _ |*) Cminor.St_return None
    3434  | Cminor.St_goto _ -> ([], [])
    3535  | Cminor.St_assign (_, e) | Cminor.St_switch (e, _, _)
     
    4343  | Cminor.St_ifthenelse (e, stmt1, stmt2) ->
    4444    ([e], [stmt1 ; stmt2])
    45   | Cminor.St_loop stmt | Cminor.St_block stmt
     45  (*| Cminor.St_loop stmt | Cminor.St_block stmt *)
    4646  | Cminor.St_label (_, stmt) | Cminor.St_cost (_, stmt)
    47         | Cminor.St_ind_0 (_, stmt) | Cminor.St_ind_inc (stmt, _) ->
     47        | Cminor.St_ind_0 (_, stmt) | Cminor.St_ind_inc (_, stmt) ->
    4848                ([], [stmt])
    4949
    5050let statement_fill_subs stmt sub_es sub_stmts =
    5151  match stmt, sub_es, sub_stmts with
    52     | (  Cminor.St_skip | Cminor.St_exit _ | Cminor.St_return None
     52    | (  Cminor.St_skip | (*Cminor.St_exit _ |*) Cminor.St_return None
    5353       | Cminor.St_goto _), _, _ -> stmt
    5454    | Cminor.St_assign (x, _), e :: _, _ ->
     
    6868    | Cminor.St_ifthenelse _, e :: _, stmt1 :: stmt2 :: _ ->
    6969      Cminor.St_ifthenelse (e, stmt1, stmt2)
    70     | Cminor.St_loop _, _, stmt :: _ ->
     70 (*   | Cminor.St_loop _, _, stmt :: _ ->
    7171      Cminor.St_loop stmt
    7272    | Cminor.St_block _, _, stmt :: _ ->
    73       Cminor.St_block stmt
     73      Cminor.St_block stmt *)
    7474    | Cminor.St_label (lbl, _), _, stmt :: _ ->
    7575      Cminor.St_label (lbl, stmt)
    7676    | Cminor.St_cost (lbl, _), _, stmt :: _ ->
    7777      Cminor.St_cost (lbl, stmt)
     78    | Cminor.St_ind_0 (i, _), _, stmt :: _ ->
     79      Cminor.St_ind_0 (i, stmt)
     80    | Cminor.St_ind_inc (i, _), _, stmt :: _ ->
     81      Cminor.St_ind_inc (i, stmt)
    7882    | _ -> assert false (* do not use on these arguments *)
    7983
Note: See TracChangeset for help on using the changeset viewer.