Changeset 2860


Ignore:
Timestamp:
Mar 13, 2013, 2:02:57 AM (4 years ago)
Author:
sacerdot
Message:

RTL printing, core dumps ATM

Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • driver/backendPrinter.ml

    r2859 r2860  
    118118     "ACC_A " ^ print_byte byte
    119119
     120let print_register n = "r_" ^ string_of_pos n
     121
     122let rTL_printing_params =
     123 { Extracted.Joint_printer.print_pass_ind = printing_pass_independent_params
     124 ; print_acc_a_reg = (fun _ -> "FOO")(*Obj.magic print_register*)
     125 ; print_acc_b_reg = (fun _ -> "FOO")(*Obj.magic print_register*)
     126 ; print_acc_a_arg = (fun _ -> "FOO")(*Obj.magic (print_argument print_register)*)
     127 ; print_acc_b_arg = (fun _ -> "FOO")(*Obj.magic (print_argument print_register)*)
     128 ; print_dpl_reg = (fun _ -> "FOO")(*Obj.magic print_register*)
     129 ; print_dph_reg = (fun _ -> "FOO")(*Obj.magic print_register*)
     130 ; print_dpl_arg = (fun _ -> "FOO")(*Obj.magic (print_argument print_register)*)
     131 ; print_dph_arg = (fun _ -> "FOO")(*Obj.magic (print_argument print_register)*)
     132 ; print_snd_arg = (fun _ -> "FOO")(*Obj.magic (print_argument print_register)*)
     133 ; print_pair_move = (fun _ -> "FOO")(*Obj.magic
     134    (fun {Extracted.Types.fst = reg; snd = arg} ->
     135      print_register reg ^ " " ^ print_argument print_register arg)*)
     136 ; print_call_args = (fun _ -> "FOO")(*Obj.magic
     137    (fun l -> String.concat " " (List.map (print_argument print_register) l))*)
     138 ; print_call_dest = (fun _ -> "FOO")(*Obj.magic
     139    (fun l -> String.concat " " (List.map print_register l))*)
     140 ; print_ext_seq = (fun rtl_seq -> assert false )
     141 }
     142
     143
    120144let joint_LTL_LIN_printing_params =
    121145 { Extracted.Joint_printer.print_pass_ind = printing_pass_independent_params
     
    152176    l)
    153177
    154 let print_LTL_program program =
    155  let res =
    156   Extracted.LTL_printer.print_LTL_program joint_LTL_LIN_printing_params program
     178let print_program pass program =
     179 let f =
     180  match pass with
     181   | Extracted.Compiler.Rtlabs_pass ->
     182      Extracted.RTL_printer.print_RTL_program rTL_printing_params
     183   | Extracted.Compiler.Rtl_separate_pass ->
     184      Extracted.RTL_printer.print_RTL_program rTL_printing_params
     185   | Extracted.Compiler.Rtl_uniq_pass ->
     186      Extracted.RTL_printer.print_RTL_program rTL_printing_params
     187   | Extracted.Compiler.Ltl_pass ->
     188      Extracted.LTL_printer.print_LTL_program joint_LTL_LIN_printing_params
     189   | _ -> fun _ -> Extracted.List.Nil
    157190 in
    158   "\n" ^ print_graph res ^ "\n"
     191  "\n" ^ print_graph (f (Obj.magic program)) ^ "\n"
  • driver/backendPrinter.mli

    r2854 r2860  
    1 (*val print_RTL_program: Extracted.RTL.rtl_program -> string*)
    2 val print_LTL_program: Extracted.LTL.ltl_program -> string
     1val print_program: Extracted.Compiler.pass -> Extracted.Preamble.__ -> string
  • driver/cerco.ml

    r2854 r2860  
    4242  let rec infinity = Extracted.Nat.S infinity in
    4343  (fun pass prog ->
    44     if pass = Extracted.Compiler.Ltl_pass then
    45      print_string (BackendPrinter.print_LTL_program (fst (Obj.magic prog)));
     44    print_string (BackendPrinter.print_program pass (fst (Obj.magic prog)));
    4645    Extracted.Semantics.run_and_print pass prog infinity
    4746     (fun p -> print_endline ("\n" ^ string_of_pass p ^ ":"); Extracted.Types.It)
Note: See TracChangeset for help on using the changeset viewer.