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

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

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

revision 219, Tue Mar 9 01:07:30 1999 UTC revision 220, Tue Mar 9 02:15:05 1999 UTC
# Line 91  Line 91 
91      structure PO = PrimOp      structure PO = PrimOp
92  in  in
93    
94  val say = Control.Print.say  val say = Control_Print.say
95  fun bug msg = ErrorMsg.impossible ("Collect: "^msg)  fun bug msg = ErrorMsg.impossible ("Collect: "^msg)
96  fun buglexp (msg,le) = (say "\n"; PP.printLexp le; say " "; bug msg)  fun buglexp (msg,le) = (say "\n"; PP.printLexp le; say " "; bug msg)
97  fun bugval (msg,v) = (say "\n"; PP.printSval v; say " "; bug msg)  fun bugval (msg,v) = (say "\n"; PP.printSval v; say " "; bug msg)
# Line 112  Line 112 
112  (* map related helper functions *)  (* map related helper functions *)
113  fun get lv = (M.map m lv)  fun get lv = (M.map m lv)
114                    handle x as NotFound =>                    handle x as NotFound =>
115                    (say ("Collect: ERROR: get unknown var "^                    ((* say ("Collect: ERROR: get unknown var "^
116                          (LV.lvarName lv)^                          (LV.lvarName lv)^
117                          ". Pretending dead...\n");                          ". Pretending dead...\n"); *)
118                     (*  raise x; *)                     (*  raise x; *)
119                     new NONE lv)                     new NONE lv)
120    
# Line 256  Line 256 
256            | F.APP (F.VAR f,vs) =>            | F.APP (F.VAR f,vs) =>
257              (call (SOME vs) f; app use vs)              (call (SOME vs) f; app use vs)
258    
259            | F.TFN ((tf,args,body),le) =>            | F.TFN ((tfk,tf,args,body),le) =>
260              let val tfi = newf (SOME[]) tf              let val tfi = newf (SOME[]) tf
261              in cexp le; if used tfi then cexp body else ()              in cexp le; if used tfi then cexp body else ()
262              end              end
# Line 345  Line 345 
345            | F.APP (F.VAR f,vs) =>            | F.APP (F.VAR f,vs) =>
346              (uncall f; app unuse vs)              (uncall f; app unuse vs)
347    
348            | F.TFN ((tf,args,body),le) =>            | F.TFN ((tfk,tf,args,body),le) =>
349               let val tfi = get tf               let val tfi = get tf
350               in if used tfi then cexp body else ();               in if used tfi then cexp body else ();
351                   def tfi; cexp le; kill tf                   def tfi; cexp le; kill tf

Legend:
Removed from v.219  
changed lines
  Added in v.220

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