Ignore:
Timestamp:
Oct 7, 2011, 1:48:26 PM (9 years ago)
Author:
tranquil
Message:

indexing branch is compiling again:

  • clight interpreter updated
  • clight labeller yet to be completed with single-entry loop detection
File:
1 edited

Legend:

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

    r1310 r1319  
    289289    Clight.LScase (i, s', ls')
    290290               
    291 (* calculating the maximal depth of single-entry loops *)
    292 (* (as already calculated during the labeling phase)   *)
    293 
    294 let rec max_loop_index =
    295         let f_expr _ _ = () in
    296   let f_stmt stmt _ sub_stmts_res =
    297                 let curr_max = List.fold_left max 0 sub_stmts_res in
    298                 match stmt with
    299                   | Clight.Swhile (Some x, _, _) | Clight.Sdowhile (Some x, _, _)
    300                   | Clight.Sfor (Some x, _, _, _, _) -> max x curr_max (* = curr_max+1 ? *)
    301                         | _ -> curr_max in
    302   ClightFold.statement2 f_expr f_stmt
    303        
    304291let rec loop_indexes_defs prefix max_depth =
    305292        if max_depth = 0 then [] else
     293        let max_depth = max_depth - 1 in
    306294  let uint = Clight.Tint(Clight.I32, AST.Unsigned) in
    307295        let id = CostLabel.make_id prefix max_depth in
    308         (id, uint) :: loop_indexes_defs prefix (max_depth-1)
     296        (id, uint) :: loop_indexes_defs prefix max_depth
    309297
    310298(* Instrument a function. *)
     
    313301  let def = match def with
    314302    | Clight.Internal def ->
    315         let max_depth = max_loop_index def.Clight.fn_body in
     303        let max_depth = ClightUtils.max_loop_index_lbld def.Clight.fn_body in
    316304        let vars = loop_indexes_defs l_ind max_depth in
    317305        let vars = List.rev_append vars def.Clight.fn_vars in
Note: See TracChangeset for help on using the changeset viewer.