Changeset 2993 for driver/printer.ml


Ignore:
Timestamp:
Mar 28, 2013, 9:56:26 AM (7 years ago)
Author:
sacerdot
Message:
  1. performance improved: the type inference was inferring load_code_memory ... in computational positions, duplicating the work at every step of execution of the assembly code. We now force the use of the let-in-ed variable
  2. new extraction after 1)
  3. driver/printer.ml repaired
  4. the output of the intermediate passes is now printed on file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/printer.ml

    r2982 r2993  
    221221    l)
    222222
    223 let print_program pass (program : Extracted.Preamble.__) =
     223let extension_of_pass =
     224 function
     225 | Extracted.Compiler.Clight_pass                -> "clight"
     226 | Extracted.Compiler.Clight_switch_removed_pass -> "clight_sr"
     227 | Extracted.Compiler.Clight_label_pass          -> "clight_l"
     228 | Extracted.Compiler.Clight_simplified_pass     -> "clight_s"
     229 | Extracted.Compiler.Cminor_pass                -> "cminor"
     230 | Extracted.Compiler.Rtlabs_pass                -> "rtlabs"
     231 | Extracted.Compiler.Rtl_separate_pass          -> "rtl"
     232 | Extracted.Compiler.Rtl_uniq_pass              -> "rtl_u"
     233 | Extracted.Compiler.Ertl_pass                  -> "ertl"
     234 | Extracted.Compiler.Ertlptr_pass               -> "ertlptr"
     235 | Extracted.Compiler.Ltl_pass                   -> "ltl"
     236 | Extracted.Compiler.Lin_pass                   -> "lin"
     237 | Extracted.Compiler.Assembly_pass              -> "assembly"
     238 | Extracted.Compiler.Object_code_pass           -> "hex"
     239;;
     240
     241
     242let print_program sourcename pass (program : Extracted.Preamble.__) =
    224243 let beprint pcs =
    225244  print_graph (pcs (Extracted.Types.fst (Obj.magic program))) in
     
    250269   | _ -> ""
    251270 in
    252   "\n" ^ lines ^ "\n"
     271  let filename =
     272   Filename.chop_extension sourcename ^ "." ^ extension_of_pass pass in
     273  let och = open_out filename in
     274  output_string och lines;
     275  close_out och
Note: See TracChangeset for help on using the changeset viewer.