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

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

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

revision 732, Mon Nov 13 21:59:12 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 30  Line 30 
30    
31  fun loopify (prog as (progkind,progname,progargs,progbody)) = let  fun loopify (prog as (progkind,progname,progargs,progbody)) = let
32    
33      val m : info Intmap.intmap = Intmap.new(128, NotFound)      val m : info IntHashTable.hash_table = IntHashTable.mkTable(128, NotFound)
34    
35      (* tails: number of tail-recursive calls      (* tails: number of tail-recursive calls
36       * calls: number of other calls       * calls: number of other calls
# Line 40  Line 40 
40      fun new (f,known,parent) =      fun new (f,known,parent) =
41          let val i = I{tails=ref [], calls=ref [], icalls=ref [],          let val i = I{tails=ref [], calls=ref [], icalls=ref [],
42                        tcp=ref known, parent=parent}                        tcp=ref known, parent=parent}
43          in Intmap.add m (f,i); i end          in IntHashTable.insert m (f,i); i end
44    
45      fun get f = Intmap.map m f      fun get f = IntHashTable.lookup m f
46    
47  (* collect tries to determine what calls are tail recursive.  (* collect tries to determine what calls are tail recursive.
48   * If a function f is always called in tail position in a function g,   * If a function f is always called in tail position in a function g,

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

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