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/compiler/CPS/cps/ppcps.sml
ViewVC logotype

Diff of /sml/trunk/compiler/CPS/cps/ppcps.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

sml/trunk/src/compiler/FLINT/cps/ppcps.sml revision 733, Fri Nov 17 05:13:45 2000 UTC sml/trunk/compiler/CPS/cps/ppcps.sml revision 4986, Fri Apr 26 17:08:01 2019 UTC
# Line 1  Line 1 
1  (* Copyright 1996 by Bell Laboratories *)  (* ppcps.sml
2  (* ppcps.sml *)   *
3     * COPYRIGHT (c) 2018 The Fellowship of SML/NJ (http://www.smlnj.org)
4     * All rights reserved.
5     *)
6    
7  signature PPCPS =  signature PPCPS =
8  sig  sig
9    
10        val value2str : CPS.value -> string
11    
12    val printcps : (CPS.function * LtyDef.lty IntHashTable.hash_table) -> unit    val printcps : (CPS.function * LtyDef.lty IntHashTable.hash_table) -> unit
13    val printcps0: CPS.function -> unit    val printcps0: CPS.function -> unit
14    val prcps : CPS.cexp -> unit    val prcps : CPS.cexp -> unit
15    
16      (* string conversions for various CPS.P types *)
17        val numkindToString : CPS.P.numkind -> string
18        val arithopToString : CPS.P.arithop -> string
19        val cmpopToString : CPS.P.cmpop -> string
20        val fcmpopToString : CPS.P.fcmpop -> string
21        val branchToString : CPS.P.branch -> string
22        val setterToString : CPS.P.setter -> string
23        val lookerToString : CPS.P.looker -> string
24        val arithToString : CPS.P.arith -> string
25        val pureToString : CPS.P.pure -> string
26    
27  end (* signature PPCPS *)  end (* signature PPCPS *)
28    
29  structure PPCps : PPCPS =  structure PPCps : PPCPS =
30  struct  struct
31    
32  local open CPS      open CPS
33        structure LV = LambdaVar        structure LV = LambdaVar
34  in      structure U = CPSUtil
35    
36  val say = Control.Print.say  val say = Control.Print.say
37    
38  val sayt = say o CPS.ctyToString      val sayt = say o U.ctyToString
   
 fun numkindName (P.INT bits) = "i" ^ Int.toString bits  
   | numkindName (P.UINT bits) = "u" ^ Int.toString bits  
   | numkindName (P.FLOAT bits) = "f" ^ Int.toString bits  
   
 fun lookerName P.! = "!"  
   | lookerName P.gethdlr = "gethdlr"  
   | lookerName P.subscript = "subscript"  
   | lookerName (P.numsubscript{kind}) = ("numsubscript" ^ numkindName kind)  
   | lookerName P.getrunvec = "getrunvec"  
   | lookerName P.getvar = "getvar"  
   | lookerName P.deflvar = "deflvar"  
   | lookerName P.getspecial = "getspecial"  
   | lookerName P.getpseudo = "getpseudo"  
   
 fun branchName P.boxed = "boxed"  
   | branchName P.unboxed = "unboxed"  
   | branchName (P.cmp{oper, kind}) =  
     (numkindName kind ^  
      (case oper  
       of P.>   => ">"  
        | P.<   => "<"  
        | P.>=  => ">="  
        | P.<=  => "<="  
        | P.eql => "="  
        | P.neq => "<>"  
       (*esac*)))  
   | branchName(P.fcmp{oper, size}) =  
     (numkindName (P.FLOAT size) ^  
      (case oper  
       of P.fEQ   => "="  
        | P.fULG  => "?<>"  
        | P.fGT   => ">"  
        | P.fGE   => ">="  
        | P.fLT   => "<"  
        | P.fLE   => "<="  
        | P.fLG   => "<>"  
        | P.fLEG  => "<=>"  
        | P.fUGT  => "?>"  
        | P.fUGE  => "?>="  
        | P.fULT  => "?<"  
        | P.fULE  => "?<="  
        | P.fUE   => "?="  
        | P.fUN   => "?"  
      (*esac*)))  
   | branchName P.pneq = "pneq"  
   | branchName P.peql = "peql"  
   | branchName P.streq = "streq"  
   | branchName P.strneq = "strneq"  
   
 fun setterName P.unboxedupdate = "unboxedupdate"  
   | setterName P.boxedupdate = "boxedupdate"  
   | setterName P.update = "update"  
   | setterName (P.numupdate{kind}) = ("numupdate" ^ numkindName kind)  
   | setterName P.unboxedassign = "unboxedassign"  
   | setterName P.assign = "assign"  
   | setterName P.sethdlr = "sethdlr"  
   | setterName P.setvar = "setvar"  
   | setterName P.uselvar = "uselvar"  
   | setterName P.free = "free"  
   | setterName P.setspecial = "setspecial"  
   | setterName P.setpseudo = "setpseudo"  
   | setterName P.setmark = "setmark"  
   | setterName P.acclink = "acclink"  
   
 fun cvtParams(from, to) = Int.toString from ^ "_" ^ Int.toString to  
   
 fun arithName (P.arith{oper,kind}) =  
     ((case oper of  P.+ => "+" |  P.- => "-" |  P.* => "*"  
                   | P./ => "/" |  P.~ => "~" | P.abs => "abs"  
                   | P.fsqrt => "fsqrt"  
                   | P.fsin => "sin" | P.fcos => "cos" | P.ftan => "tan"  
                   | P.rshift => "rshift" | P.rshiftl => "rshiftl"  
                   | P.lshift => "lshift" | P.andb => "andb"  
                   | P.orb => "orb" | P.xorb => "xorb" | P.notb => "notb")  
      ^ numkindName kind)  
   | arithName(P.test arg) = "test_" ^ cvtParams arg  
   | arithName(P.testu arg) = "testu_" ^ cvtParams arg  
   | arithName (P.round{floor=true,fromkind=P.FLOAT 64,tokind=P.INT 31}) =  
       "floor"  
   | arithName (P.round{floor=false,fromkind=P.FLOAT 64,tokind=P.INT 31}) =  
       "round"  
   | arithName (P.round{floor,fromkind,tokind}) =  
       ((if floor then "floor" else "round")  
        ^ numkindName fromkind ^ "_" ^ numkindName tokind)  
   
 fun pureName P.length = "length"  
   | pureName (P.pure_arith x) = arithName(P.arith x)  
   | pureName P.objlength = "objlength"  
   | pureName P.makeref = "makeref"  
   | pureName (P.extend arg) = "extend_" ^ cvtParams arg  
   | pureName (P.copy arg) = "copy_" ^ cvtParams arg  
   | pureName (P.trunc arg) = "trunc_" ^ cvtParams arg  
   | pureName (P.real{fromkind=P.FLOAT 64,tokind=P.INT 31}) = "real"  
   | pureName (P.real{fromkind,tokind}) =  
     ("real" ^ numkindName fromkind ^ "_" ^ numkindName tokind)  
   | pureName P.subscriptv = "subscriptv"  
   | pureName (P.pure_numsubscript{kind}) = ("numsubscriptv" ^ numkindName kind)  
   | pureName P.gettag = "gettag"  
   | pureName P.mkspecial = "mkspecial"  
   | pureName P.wrap = "wrap"  
   | pureName P.unwrap = "unwrap"  
   | pureName P.cast = "cast"  
   | pureName P.getcon = "getcon"  
   | pureName P.getexn = "getexn"  
   | pureName P.fwrap = "fwrap"  
   | pureName P.funwrap = "funwrap"  
   | pureName P.iwrap = "iwrap"  
   | pureName P.iunwrap = "iunwrap"  
   | pureName P.i32wrap = "i32wrap"  
   | pureName P.i32unwrap = "i32unwrap"  
   | pureName P.getseqdata = "getseqdata"  
   | pureName P.recsubscript = "recsubscript"  
   | pureName P.raw64subscript = "raw64subscript"  
   | pureName P.newarray0 = "newarray0"  
   
 fun show0 say =  
   let fun sayc (#"\n") = say "\\n"  
         | sayc c = say(String.str c)  
   
       fun sayv(VAR v) = say(LV.lvarName v)  
         | sayv(LABEL v) = say("(L)" ^ LV.lvarName v)  
         | sayv(INT i) = say("(I)" ^ Int.toString i)  
         | sayv(INT32 i) = say("(I32)" ^ Word32.toString i)  
         | sayv(REAL r) = say r  
         | sayv(STRING s) = (say "\""; app sayc (explode s); say "\"")  
         | sayv(OBJECT _) = say("(object)")  
         | sayv(VOID) = say("(void)")  
39    
40        fun sayvlist [v] = sayv v      fun value2str (VAR v) = LV.lvarName v
41          | sayvlist nil = ()        | value2str (LABEL v) = "(L)" ^ LV.lvarName v
42          | sayvlist (v::vl) = (sayv v; say ","; sayvlist vl)        | value2str (NUM{ival, ty={sz=0, ...}}) = "(II)" ^ IntInf.toString ival
43          | value2str (NUM{ival, ty={tag=true, ...}}) = "(I)" ^ IntInf.toString ival
44          | value2str (NUM{ival, ty={sz, ...}}) = concat[
45                "(I", Int.toString sz, ")", IntInf.toString ival
46              ]
47          | value2str (REAL{rval, ty}) = concat[
48                "(R", Int.toString ty, ")", RealLit.toString rval
49              ]
50          | value2str (STRING s) = concat["\"", String.toString s, "\""]
51          | value2str (VOID) = "(void)"
52    
53        fun numkindToString (P.INT bits) = "i" ^ Int.toString bits
54          | numkindToString (P.UINT bits) = "u" ^ Int.toString bits
55          | numkindToString (P.FLOAT bits) = "f" ^ Int.toString bits
56    
57        fun arithopToString P.ADD = "+"
58          | arithopToString P.SUB = "-"
59          | arithopToString P.MUL = "*"
60          | arithopToString P.DIV = "div"
61          | arithopToString P.MOD = "mod"
62          | arithopToString P.QUOT = "quot"
63          | arithopToString P.REM = "rem"
64          | arithopToString P.FDIV = "/"
65          | arithopToString P.NEG = "~"
66          | arithopToString P.FABS = "fabs"
67          | arithopToString P.FSQRT = "fsqrt"
68          | arithopToString P.FSIN = "sin"
69          | arithopToString P.FCOS = "cos"
70          | arithopToString P.FTAN = "tan"
71          | arithopToString P.RSHIFT = "rshift"
72          | arithopToString P.RSHIFTL = "rshiftl"
73          | arithopToString P.LSHIFT = "lshift"
74          | arithopToString P.ANDB = "andb"
75          | arithopToString P.ORB = "orb"
76          | arithopToString P.XORB = "xorb"
77          | arithopToString P.NOTB = "notb"
78    
79        fun cmpopToString P.GT = ">"
80          | cmpopToString P.LT = "<"
81          | cmpopToString P.GTE = ">="
82          | cmpopToString P.LTE = "<="
83          | cmpopToString P.EQL = "="
84          | cmpopToString P.NEQ = "<>"
85    
86        fun fcmpopToString P.F_EQ   = "="
87          | fcmpopToString P.F_ULG = "?<>"
88          | fcmpopToString P.F_GT = ">"
89          | fcmpopToString P.F_GE = ">="
90          | fcmpopToString P.F_LT = "<"
91          | fcmpopToString P.F_LE = "<="
92          | fcmpopToString P.F_LG = "<>"
93          | fcmpopToString P.F_LEG = "<="
94          | fcmpopToString P.F_UGT = "?>"
95          | fcmpopToString P.F_UGE = "?>="
96          | fcmpopToString P.F_ULT = "?<"
97          | fcmpopToString P.F_ULE = "?<="
98          | fcmpopToString P.F_UE = "?="
99          | fcmpopToString P.F_UN = "?"
100    
101        fun branchToString (P.CMP{oper, kind}) = numkindToString kind ^ cmpopToString oper
102          | branchToString (P.FCMP{oper, size}) = numkindToString (P.FLOAT size) ^ fcmpopToString oper
103          | branchToString (P.FSGN sz) = numkindToString (P.FLOAT sz) ^ "sgn"
104          | branchToString P.BOXED = "boxed"
105          | branchToString P.UNBOXED = "unboxed"
106          | branchToString P.PEQL = "peql"
107          | branchToString P.PNEQ = "pneq"
108          | branchToString P.STREQL = "streql"
109          | branchToString P.STRNEQ = "strneq"
110    
111        fun setterToString P.UNBOXEDUPDATE = "unboxedupdate"
112          | setterToString P.UPDATE = "update"
113          | setterToString (P.NUMUPDATE{kind}) = ("numupdate" ^ numkindToString kind)
114          | setterToString P.UNBOXEDASSIGN = "unboxedassign"
115          | setterToString P.ASSIGN = "assign"
116          | setterToString P.SETHDLR = "sethdlr"
117          | setterToString P.SETVAR = "setvar"
118          | setterToString P.SETSPECIAL = "setspecial"
119          | setterToString (P.RAWSTORE{kind}) = ("rawstore" ^ numkindToString kind)
120          | setterToString (P.RAWUPDATE cty) = ("rawupdate" ^ U.ctyToString cty)
121    
122        fun lookerToString P.DEREF = "!"
123          | lookerToString P.GETHDLR = "gethdlr"
124          | lookerToString P.SUBSCRIPT = "subscript"
125          | lookerToString (P.NUMSUBSCRIPT{kind}) = ("numsubscript" ^ numkindToString kind)
126          | lookerToString P.GETVAR = "getvar"
127          | lookerToString P.GETSPECIAL = "getspecial"
128          | lookerToString (P.RAWLOAD{kind}) = ("rawload" ^ numkindToString kind)
129    
130        val cvtParam = Int.toString
131        fun cvtParams (prefix, from, to) = concat [prefix, cvtParam from, "_", cvtParam to]
132    
133        fun arithToString (P.ARITH{oper, kind}) = arithopToString oper ^ numkindToString kind
134          | arithToString (P.TEST{from, to}) = cvtParams ("test_", from, to)
135          | arithToString (P.TESTU{from, to}) = cvtParams ("testu_", from, to)
136          | arithToString (P.TEST_INF i) = "test_inf_" ^ cvtParam i
137          | arithToString (P.REAL_TO_INT{floor, from, to}) = concat[
138                if floor then "floor_" else "round_", cvtParam from, "to", cvtParam to
139              ]
140    
141        fun pureToString P.LENGTH = "length"
142          | pureToString (P.PURE_ARITH{oper,kind}) = arithopToString oper ^ numkindToString kind
143          | pureToString P.OBJLENGTH = "objlength"
144          | pureToString P.MAKEREF = "makeref"
145          | pureToString (P.EXTEND{from, to}) = cvtParams ("extend_", from, to)
146          | pureToString (P.COPY{from, to}) = cvtParams ("copy_", from, to)
147          | pureToString (P.TRUNC{from, to}) = cvtParams ("trunc_", from, to)
148          | pureToString (P.TRUNC_INF i) = "trunc_inf_" ^ cvtParam i
149          | pureToString (P.COPY_INF i) = concat ["copy_", cvtParam i, "_inf"]
150          | pureToString (P.EXTEND_INF i) =  concat ["extend_", cvtParam i, "_inf"]
151          | pureToString (P.INT_TO_REAL{from, to}) =
152              concat ["real", cvtParam from, "_", cvtParam to]
153          | pureToString P.SUBSCRIPTV = "subscriptv"
154          | pureToString (P.PURE_NUMSUBSCRIPT{kind}) = "numsubscriptv" ^ numkindToString kind
155          | pureToString P.GETTAG = "gettag"
156          | pureToString P.MKSPECIAL = "mkspecial"
157          | pureToString P.CAST = "cast"
158          | pureToString P.GETCON = "getcon"
159          | pureToString P.GETEXN = "getexn"
160          | pureToString P.BOX = "box"
161          | pureToString P.UNBOX = "unbox"
162          | pureToString (P.WRAP kind) = "wrap_" ^ numkindToString kind
163          | pureToString (P.UNWRAP kind) = "unwrap_" ^ numkindToString kind
164          | pureToString P.GETSEQDATA = "getseqdata"
165          | pureToString P.RECSUBSCRIPT = "recsubscript"
166          | pureToString P.RAW64SUBSCRIPT = "raw64subscript"
167          | pureToString P.NEWARRAY0 = "newarray0"
168          | pureToString (P.RAWRECORD rk) = "rawrecord_"^getOpt(Option.map rkstring rk, "notag")
169    
170        and rkstring rk = (case rk
       fun rkstring rk = (case rk  
171          of RK_VECTOR => "RK_VECTOR"          of RK_VECTOR => "RK_VECTOR"
172           | RK_RECORD => "RK_RECORD"           | RK_RECORD => "RK_RECORD"
173           | RK_SPILL => "RK_SPILL"           | RK_SPILL => "RK_SPILL"
# Line 164  Line 178 
178           | RK_KNOWN => "RK_KNOWN"           | RK_KNOWN => "RK_KNOWN"
179           | RK_BLOCK => "RK_BLOCK"           | RK_BLOCK => "RK_BLOCK"
180           | RK_FBLOCK => "RK_FBLOCK"           | RK_FBLOCK => "RK_FBLOCK"
181           | RK_I32BLOCK => "RK_I32BLOCK")              | RK_I32BLOCK => "RK_I32BLOCK"
182              (* end case *))
183    
184        fun show0 say = let
185              fun sayc (#"\n") = say "\\n"
186                | sayc c = say(String.str c)
187    
188              fun sayv v = say(value2str v)
189    
190              fun sayvlist [v] = sayv v
191                | sayvlist nil = ()
192                | sayvlist (v::vl) = (sayv v; say ","; sayvlist vl)
193    
194        fun sayrk(RK_RECORD,n) = ()        fun sayrk(RK_RECORD,n) = ()
195          | sayrk(RK_VECTOR,n) = ()          | sayrk(RK_VECTOR,n) = ()
196          | sayrk(k,n : int) = (say (rkstring k); say " ";              | sayrk (k, n) = (say (rkstring k); say " "; say (Int.toString n); say ",")
                               say (Int.toString n); say ",")  
197    
198        fun sayparam ([v],[ct]) = (sayv v; sayt ct)        fun sayparam ([v],[ct]) = (sayv v; sayt ct)
199          | sayparam (nil,nil) = ()          | sayparam (nil,nil) = ()
# Line 182  Line 206 
206        fun sayvp (v,path) = (sayv v; saypath path)        fun sayvp (v,path) = (sayv v; saypath path)
207        fun saylist f [x] = f x | saylist f nil = ()        fun saylist f [x] = f x | saylist f nil = ()
208          | saylist f (x::r) = (f x; say ","; saylist f r)          | saylist f (x::r) = (f x; say ","; saylist f r)
209        fun indent n =            fun indent n = let
210          let fun space 0 = () | space k = (say " "; space(k-1))                  fun space 0 = () | space k = (say " "; space(k-1))
211              fun nl() = say "\n"              fun nl() = say "\n"
212              val rec f =                  fun f (RECORD(k,vl,v,c)) = (
              fn RECORD(k,vl,v,c) => (  
213                    space n;                    space n;
214                    case k of RK_VECTOR => say "#{" | _ => say "{";                    case k of RK_VECTOR => say "#{" | _ => say "{";
215                    sayrk(k,length vl);                    sayrk(k,length vl);
216                    saylist sayvp vl; say "} -> ";                    saylist sayvp vl; say "} -> ";
217                    sayv(VAR v);                    sayv(VAR v);
218                    nl(); f c)                    nl(); f c)
219                | SELECT(i,v,w,t,c) =>                    | f (SELECT(i,v,w,t,c)) = (
220                      (space n; sayv v; say "."; say(Int.toString i); say " -> ";                          space n; sayv v; say "."; say(Int.toString i); say " -> ";
221                       sayv(VAR w); sayt(t); nl(); f c)                       sayv(VAR w); sayt(t); nl(); f c)
222                | OFFSET(i,v,w,c) =>                    | f (OFFSET(i,v,w,c)) = (
223                      (space n; sayv v; say "+"; say(Int.toString i); say " -> ";                          space n; sayv v; say "+"; say(Int.toString i); say " -> ";
224                      sayv(VAR w); nl(); f c)                      sayv(VAR w); nl(); f c)
225                | APP(w,vl) =>                    | f (APP(w,vl)) = (
226                      (space n; sayv w; say "("; sayvlist vl; say ")\n")                          space n; sayv w; say "("; sayvlist vl; say ")\n")
227                | FIX(bl,c) =>                    | f (FIX(bl,c)) = let
228                      let fun g(_,v,wl,cl,d) =                          fun g (_,v,wl,cl,d) = (
229                              (space n; sayv(VAR v); say "(";                                  space n; sayv(VAR v); say "(";
230                               sayparam (map VAR wl,cl);                               sayparam (map VAR wl,cl);
231                               say ") =\n";                               say ") =\n";
232                               indent (n+3) d)                               indent (n+3) d)
233                       in app g bl; f c                          in
234                              app g bl; f c
235                      end                      end
236                | SWITCH(v,c,cl) =>                    | f (SWITCH(v,c,cl)) = let
237                     let fun g(i,c::cl) =                          fun g (i,c::cl) = (
238                          (space(n+1); say(Int.toString(i:int));                                space(n+1); say(Int.toString(i:int));
239                           say " =>\n"; indent (n+3) c; g(i+1,cl))                           say " =>\n"; indent (n+3) c; g(i+1,cl))
240                           | g(_,nil) = ()                           | g(_,nil) = ()
241                      in space n; say "case "; sayv v; say "  [";                          in
242                              space n; say "case "; sayv v; say "  [";
243                         say(Int.toString(c));                         say(Int.toString(c));
244                         say "] of\n";                         say "] of\n";
245                         g(0,cl)                         g(0,cl)
246                     end                     end
247                | LOOKER(i,vl,w,t,e) =>                    | f (LOOKER(i,vl,w,t,e)) = (
248                     (space n; say(lookerName i); say "("; sayvlist vl;                          space n; say(lookerToString i); say "("; sayvlist vl;
249                      say ") -> "; sayv(VAR w); sayt(t); nl(); f e)                      say ") -> "; sayv(VAR w); sayt(t); nl(); f e)
250                | ARITH(i,vl,w,t,e) =>                    | f (ARITH(i,vl,w,t,e)) = (
251                     (space n; say(arithName i); say "("; sayvlist vl;                          space n; say(arithToString i); say "("; sayvlist vl;
252                      say ") -> "; sayv(VAR w); sayt(t); nl(); f e)                      say ") -> "; sayv(VAR w); sayt(t); nl(); f e)
253                | PURE(i,vl,w,t,e) =>                    | f (PURE(i,vl,w,t,e)) = (
254                     (space n; say(pureName i); say "("; sayvlist vl;                          space n; say(pureToString i); say "("; sayvlist vl;
255                      say ") -> "; sayv(VAR w); sayt(t); nl(); f e)                      say ") -> "; sayv(VAR w); sayt(t); nl(); f e)
256                | SETTER(i,vl,e) =>                    | f (SETTER(i,vl,e)) = (
257                     (space n; say(setterName i); say "("; sayvlist vl;                          space n; say(setterToString i); say "("; sayvlist vl;
258                      say ")"; nl(); f e)                      say ")"; nl(); f e)
259                | BRANCH(i,vl,c,e1,e2) =>                    | f (BRANCH(i,vl,c,e1,e2)) = (
260                     (space n; say "if "; say(branchName i);                          space n; say "if "; say(branchToString i);
261                           say "("; sayvlist vl; say ") [";                           say "("; sayvlist vl; say ") [";
262                           sayv(VAR c); say "] then\n";                           sayv(VAR c); say "] then\n";
263                      indent (n+3) e1;                      indent (n+3) e1;
264                      space n; say "else\n";                      space n; say "else\n";
265                      indent (n+3) e2)                      indent (n+3) e2)
266           in f                    | f (RCC(k,l,p,vl,wtl,e)) = (
267          end                          space n;
268   in  indent                          if k = REENTRANT_RCC then say "reentrant " else ();
269                            if l = "" then () else (say l; say " ");
270                            say "rcc("; sayvlist vl; say ") -> ";
271                            app (fn (w, t) => (sayv (VAR w); sayt(t))) wtl;
272                            nl(); f e)
273                    in
274                      f
275   end   end
276              in
277                indent
278              end (* show0 *)
279    
280  fun printcps((_,f,vl,cl,e),m)=      fun printcps((_,f,vl,cl,e),m) = let
281  let fun ptv(v,t) = (say(LV.lvarName v); say " type ===>>>";            fun ptv(v,t) = (say(LV.lvarName v); say " type ===>>>";
282                      say(LtyExtern.lt_print t); say "\n")                      say(LtyExtern.lt_print t); say "\n")
   
283      val _ = if (!Control.CG.debugRep)      val _ = if (!Control.CG.debugRep)
284              then (say "************************************************\n";              then (say "************************************************\n";
285                    IntHashTable.appi ptv m;                    IntHashTable.appi ptv m;
286                    say "************************************************\n")                    say "************************************************\n")
287              else ()              else ()
   
288      fun sayv(v) = say(LV.lvarName v)      fun sayv(v) = say(LV.lvarName v)
289      fun sayparam ([v],[ct]) = (sayv v; sayt ct)      fun sayparam ([v],[ct]) = (sayv v; sayt ct)
290        | sayparam (nil,nil) = ()        | sayparam (nil,nil) = ()
# Line 260  Line 292 
292        | sayparam _ = ErrorMsg.impossible "sayparam in ppcps.sml 3435"        | sayparam _ = ErrorMsg.impossible "sayparam in ppcps.sml 3435"
293    
294   in   in
295      (say(LV.lvarName f); say "("; sayparam(vl,cl); say ") =\n";              say(LV.lvarName f); say "("; sayparam(vl,cl); say ") =\n";
296       show0 say 3 e)              show0 say 3 e
297  end  end
298    
299  exception NULLTABLE  exception NULLTABLE
# Line 272  Line 304 
304    
305  fun prcps(ce) = show0 (Control.Print.say) 1 ce  fun prcps(ce) = show0 (Control.Print.say) 1 ce
306    
 end (* toplevel local *)  
307  end (* structure PPCps *)  end (* structure PPCps *)
   

Legend:
Removed from v.733  
changed lines
  Added in v.4986

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