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/opt/optutils.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/opt/optutils.sml

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

revision 183, Sun Nov 8 16:58:19 1998 UTC revision 184, Sun Nov 8 21:18:20 1998 UTC
# Line 4  Line 4 
4  signature OPT_UTILS =  signature OPT_UTILS =
5  sig  sig
6    
7        datatype ('a,'b) either = A of 'a | B of 'b
8    
9      (* takes the fk of a function and returns the fk of the wrapper      (* takes the fk of a function and returns the fk of the wrapper
10       * along with the new fk of the actual body *)       * along with the new fk of the actual body *)
11      val fk_wrap : FLINT.fkind * FLINT.lty list option ->      val fk_wrap : FLINT.fkind * FLINT.lty list option ->
# Line 21  Line 23 
23  local structure F = FLINT  local structure F = FLINT
24        structure LK = LtyKernel        structure LK = LtyKernel
25  in  in
26        datatype ('a,'b) either = A of 'a | B of 'b
27    
28      fun bug msg = ErrorMsg.impossible ("OptUtils: "^msg)      fun bug msg = ErrorMsg.impossible ("OptUtils: "^msg)
29    
30      fun fk_wrap (F.FK_FCT,_) = (F.FK_FCT, F.FK_FCT)      fun fk_wrap ({inline,known,isrec,cconv},rtys') =
31        | fk_wrap (F.FK_FUN{isrec,known,fixed,inline},rtys') =          let val cconv' =
32          let val fixed' = case fixed                  case cconv
33                            of LK.FF_VAR(f1,f2) => LK.FF_VAR(true, f2)                   of F.CC_FUN(LK.FF_VAR(f1,f2)) => F.CC_FUN(LK.FF_VAR(true, f2))
34                             | LK.FF_FIXED => LK.FF_FIXED                    | (F.CC_FCT | F.CC_FUN(LK.FF_FIXED)) => cconv
35          in (F.FK_FUN{isrec=isrec, known=known, fixed=fixed, inline=true},              val isrec' = Option.map (fn ltys => (ltys, F.LK_UNKNOWN)) rtys'
36              F.FK_FUN{isrec=rtys', known=true, fixed=fixed', inline=inline})          in ({isrec=isrec, known=known, cconv=cconv, inline=F.IH_ALWAYS},
37                {isrec=isrec', known=true, cconv=cconv', inline=inline})
38          end          end
39    
40      fun filter ([],[]) = []      fun filter ([],[]) = []

Legend:
Removed from v.183  
changed lines
  Added in v.184

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