comparison src/compiler.sml @ 1235:a7b773f1d053

Command-line use of Iflow
author Adam Chlipala <adamc@hcoop.net>
date Tue, 13 Apr 2010 11:34:59 -0400
parents 5eac14322548
children d5ecceb7d1a1
comparison
equal deleted inserted replaced
1234:e799c8df3146 1235:a7b773f1d053
73 print : 'dst -> Print.PD.pp_desc, 73 print : 'dst -> Print.PD.pp_desc,
74 time : 'src * pmap -> 'dst option * pmap 74 time : 'src * pmap -> 'dst option * pmap
75 } 75 }
76 76
77 val debug = ref false 77 val debug = ref false
78 val doIflow = ref false
78 79
79 fun transform (ph : ('src, 'dst) phase) name = { 80 fun transform (ph : ('src, 'dst) phase) name = {
80 func = fn input => let 81 func = fn input => let
81 val () = if !debug then 82 val () = if !debug then
82 print ("Starting " ^ name ^ "....\n") 83 print ("Starting " ^ name ^ "....\n")
1070 val toMono_shake = transform mono_shake "mono_shake1" o toMono_reduce 1071 val toMono_shake = transform mono_shake "mono_shake1" o toMono_reduce
1071 1072
1072 val toMono_opt2 = transform mono_opt "mono_opt2" o toMono_shake 1073 val toMono_opt2 = transform mono_opt "mono_opt2" o toMono_shake
1073 1074
1074 val iflow = { 1075 val iflow = {
1075 func = (fn file => (Iflow.check file; file)), 1076 func = (fn file => (if !doIflow then Iflow.check file else (); file)),
1076 print = MonoPrint.p_file MonoEnv.empty 1077 print = MonoPrint.p_file MonoEnv.empty
1077 } 1078 }
1078 1079
1079 val toIflow = transform iflow "iflow" o toMono_opt2 1080 val toIflow = transform iflow "iflow" o toMono_opt2
1080 1081