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/FLINT/cps/convert.sml
ViewVC logotype

Diff of /sml/trunk/compiler/FLINT/cps/convert.sml

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

revision 717, Sun Nov 5 15:07:51 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 313  Line 313 
313         end         end
314    
315       local exception Rename       local exception Rename
316             val m : value Intmap.intmap = Intmap.new(32, Rename)             val m : value IntHashTable.hash_table =
317                   IntHashTable.mkTable(32, Rename)
318       in       in
319       (* F.lvar -> CPS.value *)       (* F.lvar -> CPS.value *)
320       fun rename v = Intmap.map m v handle Rename => VAR v       fun rename v = IntHashTable.lookup m v handle Rename => VAR v
321    
322       (* F.lvar * CPS.value -> unit *)       (* F.lvar * CPS.value -> unit *)
323       fun newname (v, w) =       fun newname (v, w) =
324         (case w of VAR w' => LV.sameName (v, w') | _ => ();         (case w of VAR w' => LV.sameName (v, w') | _ => ();
325          Intmap.add m (v, w))          IntHashTable.insert m (v, w))
326    
327       (* F.lvar list * CPS.value list -> unit *)       (* F.lvar list * CPS.value list -> unit *)
328       fun newnames (v::vs, w::ws) = (newname(v,w); newnames(vs, ws))       fun newnames (v::vs, w::ws) = (newname(v,w); newnames(vs, ws))
# Line 333  Line 334 
334           (* If the function is in the global renaming table and it's           (* If the function is in the global renaming table and it's
335            * renamed to itself, then it's most likely a while loop and            * renamed to itself, then it's most likely a while loop and
336            * should *not* be eta-reduced *)            * should *not* be eta-reduced *)
337           if ((case Intmap.map m lv of VAR lv' => lv = lv' | _ => false)           if ((case IntHashTable.lookup m lv of
338                      VAR lv' => lv = lv'
339                    | _ => false)
340                   handle Rename => false) then NONE else                   handle Rename => false) then NONE else
341               let fun h (x::xs, y::ys) =               let fun h (x::xs, y::ys) =
342                       if (veq(x, y)) andalso (not (veq(w, y)))                       if (veq(x, y)) andalso (not (veq(w, y)))

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

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