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

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

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

revision 422, Sun Sep 5 22:49:38 1999 UTC revision 423, Mon Sep 6 02:32:11 1999 UTC
# Line 356  Line 356 
356          fun select ((tvar,tkind),tyc) = (tvar,tyc)          fun select ((tvar,tkind),tyc) = (tvar,tyc)
357          val tvtcs = ListPair.map select (tvks, ts)          val tvtcs = ListPair.map select (tvks, ts)
358          fun cmp ((tvar1,_), (tvar2,_)) = tvar1 > tvar2          fun cmp ((tvar1,_), (tvar2,_)) = tvar1 > tvar2
359          val tvtcs = Sort.sort cmp tvtcs          val tvtcs = ListMergeSort.sort cmp tvtcs
360      in      in
361          mergesmaps (tvtcs, smap)          mergesmaps (tvtcs, smap)
362      end      end
363  (***** end of the substitution intmapf hack *********************)  (***** end of the substitution intmapf hack *********************)
364    
365  (***** the nvar-depth intmapf: named variable -> DI.depth *********)  (***** the nvar-depth intmapf: named variable -> DI.depth *********)
366  type nmap = DI.depth IntmapF.intmap  type nmap = DI.depth IntBinaryMap.map
367  val initnmap = IntmapF.empty  val initnmap = IntBinaryMap.empty
368  fun addnmap (tvks, d, nmap) =  fun addnmap (tvks, d, nmap) =
369    let fun h ((tv,_)::xs, nmap) =    let fun h ((tv,_)::xs, nmap) =
370             h(xs, IntmapF.add(nmap, tv, d))             h(xs, IntBinaryMap.insert(nmap, tv, d))
371          | h ([], nmap) = nmap          | h ([], nmap) = nmap
372     in h(tvks, nmap)     in h(tvks, nmap)
373    end    end
374  fun looknmap nmap nvar =  fun looknmap nmap nvar =
375      ((IntmapF.lookup nmap nvar) handle IntmapF.IntmapF =>      case IntBinaryMap.find(nmap, nvar) of SOME d => d | NONE => DI.top
376       bug "unexpected case in looknmap")       (*  bug "unexpected case in looknmap") *)
377  (***** end of the substitution intmapf hack *********************)  (***** end of the substitution intmapf hack *********************)
378    
379  fun phase x = Stats.doPhase (Stats.makePhase x)  fun phase x = Stats.doPhase (Stats.makePhase x)

Legend:
Removed from v.422  
changed lines
  Added in v.423

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