comparison src/compiler.sml @ 1079:d069b193ed6b

Especialize uses a termination measure based on number of arguments introduced
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Dec 2009 19:26:52 -0500
parents 3bc726a822fb
children 4b2f50829af5
comparison
equal deleted inserted replaced
1078:b9321bcefb42 1079:d069b193ed6b
69 func : 'src -> 'dst option, 69 func : 'src -> 'dst option,
70 print : 'dst -> Print.PD.pp_desc, 70 print : 'dst -> Print.PD.pp_desc,
71 time : 'src * pmap -> 'dst option * pmap 71 time : 'src * pmap -> 'dst option * pmap
72 } 72 }
73 73
74 val debug = ref false
75
74 fun transform (ph : ('src, 'dst) phase) name = { 76 fun transform (ph : ('src, 'dst) phase) name = {
75 func = fn input => let 77 func = fn input => let
78 val () = if !debug then
79 print ("Starting " ^ name ^ "....\n")
80 else
81 ()
76 val v = #func ph input 82 val v = #func ph input
77 in 83 in
84 if !debug then
85 print ("Finished " ^ name ^ ".\n")
86 else
87 ();
78 if ErrorMsg.anyErrors () then 88 if ErrorMsg.anyErrors () then
79 NONE 89 NONE
80 else 90 else
81 SOME v 91 SOME v
82 end, 92 end,