Ignore:
Timestamp:
Nov 23, 2011, 5:43:24 PM (9 years ago)
Author:
tranquil
Message:

merge of indexed labels branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/cminor/cminorToRTLabs.ml

    r818 r1542  
    194194      let (rtlabs_fun, r2) = choose_destination rtlabs_fun lenv e2 in
    195195      let old_entry = rtlabs_fun.RTLabs.f_entry in
    196       let stmt = RTLabs.St_op2 (op2, destr, r1, r2, old_entry) in
     196      let r1_arg = RTLabs.Reg r1 in
     197      let r2_arg = RTLabs.Reg r2 in
     198      let stmt = RTLabs.St_op2 (op2, destr, r1_arg, r2_arg, old_entry) in
    197199      let rtlabs_fun = generate rtlabs_fun stmt in
    198200      translate_exprs rtlabs_fun lenv [r1 ; r2] [e1 ; e2]
     
    201203      let (rtlabs_fun, r) = choose_destination rtlabs_fun lenv e in
    202204      let old_entry = rtlabs_fun.RTLabs.f_entry in
    203       let stmt = RTLabs.St_load (chunk, r, destr, old_entry) in
     205      let stmt =
     206        RTLabs.St_load (chunk, RTLabs.Reg r, destr, old_entry) in
    204207      let rtlabs_fun = generate rtlabs_fun stmt in
    205208      translate_expr rtlabs_fun lenv r e
     
    269272    (rtlabs_fun : RTLabs.internal_function)
    270273    (lenv       : local_env)
    271     (exits      : Label.t list)
     274(*    (exits      : Label.t list) *)
    272275    (stmt       : Cminor.statement)
    273276    : RTLabs.internal_function =
     
    283286      let (rtlabs_fun, r) = choose_destination rtlabs_fun lenv e2 in
    284287      let old_entry = rtlabs_fun.RTLabs.f_entry in
    285       let stmt = RTLabs.St_store (chunk, addr, r, old_entry) in
     288      let stmt =
     289        RTLabs.St_store (chunk, RTLabs.Reg addr, RTLabs.Reg r, old_entry) in
    286290      let rtlabs_fun = generate rtlabs_fun stmt in
    287291      translate_exprs rtlabs_fun lenv [addr ; r] [e1 ; e2]
     
    321325
    322326    | Cminor.St_seq (s1, s2) ->
    323       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s2 in
    324       translate_stmt rtlabs_fun lenv exits s1
     327      let rtlabs_fun = translate_stmt rtlabs_fun lenv (*exits*) s2 in
     328      translate_stmt rtlabs_fun lenv (*exits*) s1
    325329
    326330    | Cminor.St_ifthenelse (e, s1, s2) ->
    327331      let old_entry = rtlabs_fun.RTLabs.f_entry in
    328       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s2 in
     332      let rtlabs_fun = translate_stmt rtlabs_fun lenv (*exits*) s2 in
    329333      let lbl_false = rtlabs_fun.RTLabs.f_entry in
    330334      let rtlabs_fun = change_entry rtlabs_fun old_entry in
    331       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s1 in
     335      let rtlabs_fun = translate_stmt rtlabs_fun lenv (*exits*) s1 in
    332336      let lbl_true = rtlabs_fun.RTLabs.f_entry in
    333337      translate_branch rtlabs_fun lenv e lbl_true lbl_false
    334338
    335     | Cminor.St_loop s ->
     339(*    | Cminor.St_loop s ->
    336340      let loop_start = fresh_label rtlabs_fun in
    337341      let rtlabs_fun = change_entry rtlabs_fun loop_start in
     
    345349
    346350    | Cminor.St_exit n ->
    347       change_entry rtlabs_fun (List.nth exits n)
     351      change_entry rtlabs_fun (List.nth exits n) *)
    348352
    349353    | Cminor.St_return eopt ->
     
    362366
    363367    | Cminor.St_label (lbl, s) ->
    364       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in
     368      let rtlabs_fun = translate_stmt rtlabs_fun lenv (*exits*) s in
    365369      let old_entry = rtlabs_fun.RTLabs.f_entry in
    366370      add_graph rtlabs_fun lbl (RTLabs.St_skip old_entry)
    367371
    368372    | Cminor.St_cost (lbl, s) ->
    369       let rtlabs_fun = translate_stmt rtlabs_fun lenv exits s in
     373      let rtlabs_fun = translate_stmt rtlabs_fun lenv (*exits*) s in
    370374      let old_entry = rtlabs_fun.RTLabs.f_entry in
    371375      generate rtlabs_fun (RTLabs.St_cost (lbl, old_entry))
     376
     377    | Cminor.St_ind_0 (i, s) ->
     378      let rtlabs_fun = translate_stmt rtlabs_fun lenv s in
     379      let old_entry = rtlabs_fun.RTLabs.f_entry in
     380      generate rtlabs_fun (RTLabs.St_ind_0 (i, old_entry))
     381
     382    | Cminor.St_ind_inc (i, s) ->
     383      let rtlabs_fun = translate_stmt rtlabs_fun lenv s in
     384      let old_entry = rtlabs_fun.RTLabs.f_entry in
     385      generate rtlabs_fun (RTLabs.St_ind_inc (i, old_entry))
    372386
    373387    | Cminor.St_goto lbl ->
     
    446460
    447461  (* Complete the graph *)
    448   translate_stmt rtlabs_fun lenv [] f_def.Cminor.f_body
     462  translate_stmt rtlabs_fun lenv (*[]*) f_def.Cminor.f_body
    449463
    450464
Note: See TracChangeset for help on using the changeset viewer.