Ignore:
Timestamp:
Oct 6, 2011, 11:07:04 AM (9 years ago)
Author:
tranquil
Message:

added indexes to loop constructors. Branch does not compile atm

File:
1 edited

Legend:

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

    r1291 r1305  
    218218
    219219let rec print_stmt p s =
     220        let print_loop_depth = function
     221    | None -> ()
     222    | Some x -> fprintf p "/* single entry loop depth: %d */@" x in
    220223  match s with
    221224  | Sskip ->
     
    243246              print_stmt s1
    244247              print_stmt s2
    245   | Swhile(e, s) ->
     248  | Swhile(i, e, s) ->
     249                  print_loop_depth i;
    246250      fprintf p "@[<v 2>while (%a) {@ %a@;<0 -2>}@]"
    247251              print_expr e
    248252              print_stmt s
    249   | Sdowhile(e, s) ->
     253  | Sdowhile(i, e, s) ->
     254      print_loop_depth i;
    250255      fprintf p "@[<v 2>do {@ %a@;<0 -2>} while(%a);@]"
    251256              print_stmt s
    252257              print_expr e
    253   | Sfor(s_init, e, s_iter, s_body) ->
     258  | Sfor(i, s_init, e, s_iter, s_body) ->
     259      print_loop_depth i;
    254260      fprintf p "@[<v 2>for (@[<hv 0>%a;@ %a;@ %a) {@]@ %a@;<0 -2>}@]"
    255261              print_stmt_for s_init
     
    471477  | Ssequence(s1, s2) -> collect_stmt s1; collect_stmt s2
    472478  | Sifthenelse(e, s1, s2) -> collect_expr e; collect_stmt s1; collect_stmt s2
    473   | Swhile(e, s) -> collect_expr e; collect_stmt s
    474   | Sdowhile(e, s) -> collect_stmt s; collect_expr e
    475   | Sfor(s_init, e, s_iter, s_body) ->
     479  | Swhile(_, e, s) -> collect_expr e; collect_stmt s
     480  | Sdowhile(_, e, s) -> collect_stmt s; collect_expr e
     481  | Sfor(_, s_init, e, s_iter, s_body) ->
    476482      collect_stmt s_init; collect_expr e;
    477483      collect_stmt s_iter; collect_stmt s_body
Note: See TracChangeset for help on using the changeset viewer.