Home My Page Projects Code Snippets Project Openings SML/NJ
 Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

# SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/FLINT/main/flintcomp.sml
 [smlnj] / sml / trunk / src / compiler / FLINT / main / flintcomp.sml # Diff of /sml/trunk/src/compiler/FLINT/main/flintcomp.sml

revision 162, Tue Oct 27 22:16:21 1998 UTC revision 163, Thu Oct 29 21:00:27 1998 UTC
# Line 23  Line 23
23
24  fun phase x = Stats.doPhase (Stats.makePhase x)  fun phase x = Stats.doPhase (Stats.makePhase x)
25
26  val lcontract = phase "Compiler 052 lcontract" LContract.lcontract  (*  val lcontract = phase "Compiler 052 lcontract" LContract.lcontract  *)
27  val fcontract = phase "Compiler 052 fcontract" FContract.contract  val fcontract = phase "Compiler 052 fcontract" FContract.contract
28  val specialize= phase "Compiler 053 specialize" Specialize.specialize  val specialize= phase "Compiler 053 specialize" Specialize.specialize
29  val wrapping  = phase "Compiler 054 wrapping" Wrapping.wrapping  val wrapping  = phase "Compiler 054 wrapping" Wrapping.wrapping
# Line 92  Line 92
92         * r:boot         whether it has gone through reify yet         * r:boot         whether it has gone through reify yet
93         * l:string       last phase through which it went *)         * l:string       last phase through which it went *)
94        fun runphase (p as "fcontract",(f,r,l)) = (fcontract f, r, p)        fun runphase (p as "fcontract",(f,r,l)) = (fcontract f, r, p)
95          | runphase (p as "lcontract",(f,r,l)) = (lcontract f, r, p)  (*      | runphase (p as "lcontract",(f,r,l)) = (lcontract f, r, p) *)
96          | runphase (p as "fixfix",(f,r,l)) = (fixfix f, r, p)          | runphase (p as "fixfix",(f,r,l)) = (fixfix f, r, p)
97          | runphase (p as "wrap",(f,false,l)) = (wrapping f, false, p)          | runphase (p as "wrap",(f,false,l)) = (wrapping f, false, p)
98          | runphase (p as "specialize",(f,false,l)) = (specialize f, false, p)          | runphase (p as "specialize",(f,false,l)) = (specialize f, false, p)
# Line 101  Line 101
101          (* pseudo FLINT phases *)          (* pseudo FLINT phases *)
102          | runphase ("id",(f,r,l)) = (f,r,l)          | runphase ("id",(f,r,l)) = (f,r,l)
103          | runphase (p as "print",(f,r,l)) =          | runphase (p as "print",(f,r,l)) =
104            (say("\n[ After "^l^"... ]\n"); PPFlint.printFundec f; (f,r,l))            (say("\n[ After "^l^"... ]\n\n");
105               PPFlint.printFundec f; (f,r,l)
106               before say "\n")
107          | runphase ("check",(f,r,l)) =          | runphase ("check",(f,r,l)) =
108            (check (ChkFlint.checkTop, PPFlint.printFundec, "FLINT")            (check (ChkFlint.checkTop, PPFlint.printFundec, "FLINT")
109                   (ref true, r, l) f; (f,r,l))                   (ref true, r, l) f; (f,r,l))
# Line 113  Line 115
115        fun print (f,r,l) = (prF l f; (f, r, l))        fun print (f,r,l) = (prF l f; (f, r, l))
116        fun check (f,r,l) = (chkF (r, l) f; (f, r, l))        fun check (f,r,l) = (chkF (r, l) f; (f, r, l))
117
118          fun runphase' (arg as (_,{1=f,...})) = ((runphase arg)
119                                     handle x => (dumpTerm(PPFlint.printFundec,"FLINT.bug", f); raise x))
120
121        (* the "id" phases is just added to do the print/check at the entrance *)        (* the "id" phases is just added to do the print/check at the entrance *)
122        val (flint,true,_) = foldl (check o print o runphase)        val (flint,r,_) = foldl (check o print o runphase')
123                                   (flint,false,"flintnm")                                   (flint,false,"flintnm")
124                                   ("id" :: !CTRL.phases)                                   ("id" :: !CTRL.phases)
125          val flint = if r then flint else (say "\n!!Forgot reify!!\n"; reify flint)
126
127  (*        val _ = (chkF (false,"1") o prF "Translation/Normalization") flint *)  (*        val _ = (chkF (false,"1") o prF "Translation/Normalization") flint *)
128  (*        val flint = (chkF (false,"2") o prF "Fcontract" o fcontract) flint *)  (*        val flint = (chkF (false,"2") o prF "Fcontract" o fcontract) flint *)

Legend:
 Removed from v.162 changed lines Added in v.163

 root@smlnj-gforge.cs.uchicago.edu ViewVC Help Powered by ViewVC 1.0.0