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 fcollect = phase "Compiler 052a fcollect" Collect.collect |
val fcollect = phase "Compiler 052a fcollect" Collect.collect |
28 |
val fcontract = phase "Compiler 052b fcontract" FContract.contract |
val fcontract = phase "Compiler 052b fcontract" FContract.contract |
29 |
val fcontract = fcontract o fcollect |
val fcontract = fcontract o fcollect |
95 |
* r:boot whether it has gone through reify yet |
* r:boot whether it has gone through reify yet |
96 |
* l:string last phase through which it went *) |
* l:string last phase through which it went *) |
97 |
fun runphase (p as "fcontract",(f,r,l)) = (fcontract f, r, p) |
fun runphase (p as "fcontract",(f,r,l)) = (fcontract f, r, p) |
98 |
(* | runphase (p as "lcontract",(f,r,l)) = (lcontract f, r, p) *) |
| runphase (p as "lcontract",(f,r,l)) = (lcontract f, r, p) |
99 |
| runphase (p as "fixfix",(f,r,l)) = (fixfix f, r, p) |
| runphase (p as "fixfix",(f,r,l)) = (fixfix f, r, p) |
100 |
| runphase (p as "wrap",(f,false,l)) = (wrapping f, false, p) |
| runphase (p as "wrap",(f,false,l)) = (wrapping f, false, p) |
101 |
| runphase (p as "specialize",(f,false,l)) = (specialize f, false, p) |
| runphase (p as "specialize",(f,false,l)) = (specialize f, false, p) |
118 |
fun print (f,r,l) = (prF l f; (f, r, l)) |
fun print (f,r,l) = (prF l f; (f, r, l)) |
119 |
fun check (f,r,l) = (chkF (r, l) f; (f, r, l)) |
fun check (f,r,l) = (chkF (r, l) f; (f, r, l)) |
120 |
|
|
121 |
fun runphase' (arg as (_,{1=f,...})) = ((runphase arg) |
fun runphase' (arg as (p,{1=f,...})) = |
122 |
handle x => (dumpTerm(PPFlint.printFundec,"FLINT.bug", f); raise x)) |
((* say("Phase "^p^"..."); *) |
123 |
|
(runphase arg) (* before *) |
124 |
|
(* say("..."^p^" Done.\n") *)) |
125 |
|
handle x => (dumpTerm(PPFlint.printFundec,"FLINT.bug", f); raise x) |
126 |
|
|
127 |
(* 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 *) |
128 |
val (flint,r,_) = foldl (check o print o runphase') |
val (flint,r,_) = foldl (check o print o runphase') |
129 |
(flint,false,"flintnm") |
(flint,false,"flintnm") |
130 |
("id" :: !CTRL.phases) |
((* "id" :: *) !CTRL.phases) |
131 |
val flint = if r then flint else (say "\n!!Forgot reify!!\n"; reify flint) |
val flint = if r then flint else (say "\n!!Forgot reify!!\n"; reify flint) |
132 |
|
|
133 |
(* val _ = (chkF (false,"1") o prF "Translation/Normalization") flint *) |
(* val _ = (chkF (false,"1") o prF "Translation/Normalization") flint *) |