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/cm/main/autoload.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/main/autoload.sml

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

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 652, Tue Jun 6 02:14:56 2000 UTC
# Line 117  Line 117 
117              fun otherwise _ = EM.impossible "Autoload:lookpend"              fun otherwise _ = EM.impossible "Autoload:lookpend"
118          in          in
119              case SymbolMap.find (pend, sy) of              case SymbolMap.find (pend, sy) of
120                  SOME (x as ((_, e), _)) =>                  SOME (x as ((_, e, _), _)) =>
121                      (announce ();                      (announce ();
122                       load := SymbolMap.insert (!load, sy, x);                       load := SymbolMap.insert (!load, sy, x);
123                       BuildDepend.look otherwise e sy)                       BuildDepend.look otherwise e sy)
# Line 132  Line 132 
132    
133          (* However, we want to avoid hanging on to stuff unnecessarily, so          (* However, we want to avoid hanging on to stuff unnecessarily, so
134           * we now look for symbols that become available "for free" because           * we now look for symbols that become available "for free" because
135           * their corresponding node has been picked.  So we first build           * their corresponding node has been picked. *)
136           * three sets: sml- and stable-infos of picked nodes: *)  
137          fun add ((((_, DG.SB_SNODE (DG.SNODE { smlinfo, ... })), _), _),          fun add (((_, _, ss), _), allsyms) = SymbolSet.union (ss, allsyms)
138                   (ss, bs)) =  
139              (SmlInfoSet.add (ss, smlinfo), bs)          val pickedsyms = SymbolMap.foldl add SymbolSet.empty loadmap0
140            | add ((((_, DG.SB_BNODE (DG.BNODE { bininfo, ... }, _)), _), _),  
141                   (ss, bs)) =          fun isPicked ((_, _, ss), _) =
142              (ss, StableSet.add (bs, bininfo))              not (SymbolSet.isEmpty (SymbolSet.intersection (ss, pickedsyms)))
   
         val (smlinfos, stableinfos) =  
             SymbolMap.foldl add (SmlInfoSet.empty, StableSet.empty) loadmap0  
   
         (* now we can easily find out whether a node has been picked... *)  
         fun isPicked (((_, DG.SB_SNODE (DG.SNODE n)), _), _) =  
             SmlInfoSet.member (smlinfos, #smlinfo n)  
           | isPicked (((_, DG.SB_BNODE (DG.BNODE n, _)), _), _) =  
             StableSet.member (stableinfos, #bininfo n)  
143    
144          val loadmap = SymbolMap.filter isPicked pend          val loadmap = SymbolMap.filter isPicked pend
145          val noloadmap = SymbolMap.filter (not o isPicked) pend          val noloadmap = SymbolMap.filter (not o isPicked) pend

Legend:
Removed from v.651  
changed lines
  Added in v.652

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