Ignore:
Timestamp:
Oct 7, 2011, 5:47:39 PM (9 years ago)
Author:
tranquil
Message:
  • bug in ClightUtilities?.find_max_depth_lbld fixed
  • single-entry loop detection completed
  • work on Clight completed
File:
1 edited

Legend:

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

    r1305 r1328  
    217217      print_expr_list p (false, et)
    218218
     219let print_loop_depth p = function
     220        | None -> fprintf p ""
     221        | Some x -> fprintf p "/* single entry loop depth: %d */@," x
     222
    219223let 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
    223224  match s with
    224225  | Sskip ->
     
    247248              print_stmt s2
    248249  | Swhile(i, e, s) ->
    249                   print_loop_depth i;
    250       fprintf p "@[<v 2>while (%a) {@ %a@;<0 -2>}@]"
     250      fprintf p "@[<v 2>%a@ while (%a) {@ %a@;<0 -2>}@]"
     251                                print_loop_depth i
    251252              print_expr e
    252253              print_stmt s
    253254  | Sdowhile(i, e, s) ->
    254       print_loop_depth i;
    255       fprintf p "@[<v 2>do {@ %a@;<0 -2>} while(%a);@]"
     255      fprintf p "@[<v 2>%a@ do {@ %a@;<0 -2>} while(%a);@]"
     256                                print_loop_depth i
    256257              print_stmt s
    257258              print_expr e
    258259  | Sfor(i, s_init, e, s_iter, s_body) ->
    259       print_loop_depth i;
    260       fprintf p "@[<v 2>for (@[<hv 0>%a;@ %a;@ %a) {@]@ %a@;<0 -2>}@]"
     260      fprintf p "@[<v 0>%a@[<v 2>for (@[<hv 0>%a;@ %a;@ %a) {@]@ %a@;<0 -2>}@]@]"
     261                                print_loop_depth i
    261262              print_stmt_for s_init
    262263              print_expr e
Note: See TracChangeset for help on using the changeset viewer.