comparison src/compiler.sml @ 1254:935a981f4380

Merge
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 May 2010 13:57:01 -0400
parents beb67ff4c8a0
children 79b2bcac6200
comparison
equal deleted inserted replaced
1198:b52929351402 1254:935a981f4380
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")
1069 1070
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
1075 val iflow = {
1076 func = (fn file => (if !doIflow then Iflow.check file else (); file)),
1077 print = MonoPrint.p_file MonoEnv.empty
1078 }
1079
1080 val toIflow = transform iflow "iflow" o toMono_opt2
1081
1074 val jscomp = { 1082 val jscomp = {
1075 func = JsComp.process, 1083 func = JsComp.process,
1076 print = MonoPrint.p_file MonoEnv.empty 1084 print = MonoPrint.p_file MonoEnv.empty
1077 } 1085 }
1078 1086
1079 val toJscomp = transform jscomp "jscomp" o toMono_opt2 1087 val toJscomp = transform jscomp "jscomp" o toIflow
1080 1088
1081 val toMono_opt3 = transform mono_opt "mono_opt3" o toJscomp 1089 val toMono_opt3 = transform mono_opt "mono_opt3" o toJscomp
1082 1090
1083 val fuse = { 1091 val fuse = {
1084 func = Fuse.fuse, 1092 func = Fuse.fuse,