Changeset 2868


Ignore:
Timestamp:
Mar 14, 2013, 12:04:08 AM (4 years ago)
Author:
sacerdot
Message:

Pretty printing of ERTL and ERTLptr code.

Files:
6 added
1 edited

Legend:

Unmodified
Added
Removed
  • driver/backendPrinter.ml

    r2864 r2868  
    141141 }
    142142
     143let print_move_dst =
     144 function
     145    Extracted.ERTL.PSD reg -> print_register reg
     146  | Extracted.ERTL.HDW reg -> print_Register reg
     147
     148let eRTL_printing_params =
     149 { Extracted.Joint_printer.print_pass_ind = printing_pass_independent_params
     150 ; print_acc_a_reg = Obj.magic print_register
     151 ; print_acc_b_reg = Obj.magic print_register
     152 ; print_acc_a_arg = Obj.magic (print_argument print_register)
     153 ; print_acc_b_arg = Obj.magic (print_argument print_register)
     154 ; print_dpl_reg = Obj.magic print_register
     155 ; print_dph_reg = Obj.magic print_register
     156 ; print_dpl_arg = Obj.magic (print_argument print_register)
     157 ; print_dph_arg = Obj.magic (print_argument print_register)
     158 ; print_snd_arg = Obj.magic (print_argument print_register)
     159 ; print_pair_move = Obj.magic
     160    (fun {Extracted.Types.fst = dst; snd = src} ->
     161      print_move_dst dst ^ " " ^ print_argument print_move_dst src )
     162 ; print_call_args =
     163    Obj.magic (fun n -> string_of_int (Extracted.Glue.int_of_matitanat n))
     164 ; print_call_dest = (fun _ -> "")
     165 ; print_ext_seq = (fun ertl_seq -> "TODO" )
     166 }
     167
     168let eRTLptr_printing_params =
     169 { Extracted.Joint_printer.print_pass_ind = printing_pass_independent_params
     170 ; print_acc_a_reg = Obj.magic print_register
     171 ; print_acc_b_reg = Obj.magic print_register
     172 ; print_acc_a_arg = Obj.magic (print_argument print_register)
     173 ; print_acc_b_arg = Obj.magic (print_argument print_register)
     174 ; print_dpl_reg = Obj.magic print_register
     175 ; print_dph_reg = Obj.magic print_register
     176 ; print_dpl_arg = Obj.magic (print_argument print_register)
     177 ; print_dph_arg = Obj.magic (print_argument print_register)
     178 ; print_snd_arg = Obj.magic (print_argument print_register)
     179 ; print_pair_move = Obj.magic
     180    (fun {Extracted.Types.fst = dst; snd = src} ->
     181      print_move_dst dst ^ " " ^ print_argument print_move_dst src )
     182 ; print_call_args =
     183    Obj.magic (fun n -> string_of_int (Extracted.Glue.int_of_matitanat n))
     184 ; print_call_dest = (fun _ -> "")
     185 ; print_ext_seq = (fun ertl_seq -> "TODO")
     186 }
    143187
    144188let joint_LTL_LIN_printing_params =
     
    181225   | Extracted.Compiler.Rtl_separate_pass ->
    182226      Extracted.RTL_printer.print_RTL_program rTL_printing_params
    183        (Extracted.Types.fst (Obj.magic program))
    184227   | Extracted.Compiler.Rtl_uniq_pass ->
    185228      Extracted.RTL_printer.print_RTL_program rTL_printing_params
    186        (Extracted.Types.fst (Obj.magic program))
     229   | Extracted.Compiler.Ertl_pass ->
     230      Extracted.ERTL_printer.print_ERTL_program eRTL_printing_params
     231   | Extracted.Compiler.Ertlptr_pass ->
     232      Extracted.ERTLptr_printer.print_ERTLptr_program eRTLptr_printing_params
    187233   | Extracted.Compiler.Ltl_pass ->
    188234      Extracted.LTL_printer.print_LTL_program joint_LTL_LIN_printing_params
    189        (Extracted.Types.fst (Obj.magic program))
    190    | _ -> Extracted.List.Nil
     235   | _ -> (fun _ -> Extracted.List.Nil)
    191236 in
    192   "\n" ^ print_graph lines ^ "\n"
     237  "\n" ^ print_graph (lines (Extracted.Types.fst (Obj.magic program))) ^ "\n"
Note: See TracChangeset for help on using the changeset viewer.