Ignore:
Timestamp:
Mar 2, 2011, 3:27:41 PM (9 years ago)
Author:
ayache
Message:

Update of D2.2 from Paris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/LIN/LINToASM.ml

    r486 r619  
    129129
    130130
    131 (* Move the first cost label of each function at the beginning of the
    132    function. Indeed, some preamble instructions (such as frame creation) might
    133    get in the way.  *)
    134 
    135 let move_first_cost_label_up_code =
    136   let rec aux preamble = function
    137     | [] -> preamble
    138     | LIN.St_cost lbl :: code -> LIN.St_cost lbl :: preamble @ code
    139     | inst :: code -> aux (preamble @ [inst]) code
    140   in aux []
    141 
    142 let move_first_cost_label_up_funct (id, def) =
    143   let def' = match def with
    144     | LIN.F_int int_def -> LIN.F_int (move_first_cost_label_up_code int_def)
    145     | _ -> def in
    146   (id, def')
    147 
    148 let move_first_cost_label_up p =
    149   { p with LIN.functs = List.map move_first_cost_label_up_funct p.LIN.functs }
    150 
    151 
    152131(* Translating programs.
    153132
     
    165144  let tmp_universe = Label.Gen.new_universe fresh_tmp in
    166145  let glbls_addr = globals_addr p.LIN.vars in
    167   { ASM.preamble = p.LIN.vars ;
    168     ASM.exit_label = exit_label ;
    169     ASM.code =
    170       translate_functs tmp_universe glbls_addr exit_label p.LIN.main
    171         p.LIN.functs ;
    172     ASM.has_main = p.LIN.main <> None }
     146  let p =
     147    { ASM.ppreamble = p.LIN.vars ;
     148      ASM.pexit_label = exit_label ;
     149      ASM.pcode =
     150        translate_functs tmp_universe glbls_addr exit_label p.LIN.main
     151          p.LIN.functs ;
     152      ASM.phas_main = p.LIN.main <> None } in
     153  ASMInterpret.assembly p
Note: See TracChangeset for help on using the changeset viewer.