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 505, Thu Dec 9 08:24:08 1999 UTC revision 537, Fri Feb 18 17:20:16 2000 UTC
# Line 137  Line 137 
137          (* However, we want to avoid hanging on to stuff unnecessarily, so          (* However, we want to avoid hanging on to stuff unnecessarily, so
138           * we now look for symbols that become available "for free" because           * we now look for symbols that become available "for free" because
139           * their corresponding node has been picked.  So we first build           * their corresponding node has been picked.  So we first build
140           * three sets: sml- and stable-infos of picked nodes as well           * three sets: sml- and stable-infos of picked nodes: *)
          * as the set of PNODEs: *)  
141          fun add ((((_, DG.SB_SNODE (DG.SNODE { smlinfo, ... })), _), _),          fun add ((((_, DG.SB_SNODE (DG.SNODE { smlinfo, ... })), _), _),
142                   (ss, bs, ps)) =                   (ss, bs)) =
143              (SmlInfoSet.add (ss, smlinfo), bs, ps)              (SmlInfoSet.add (ss, smlinfo), bs)
144            | add ((((_, DG.SB_BNODE (DG.BNODE { bininfo, ... }, _)), _), _),            | add ((((_, DG.SB_BNODE (DG.BNODE { bininfo, ... }, _)), _), _),
145                   (ss, bs, ps)) =                   (ss, bs)) =
146              (ss, StableSet.add (bs, bininfo), ps)              (ss, StableSet.add (bs, bininfo))
           | add ((((_, DG.SB_BNODE (DG.PNODE p, _)), _), _), (ss, bs, ps)) =  
             (ss, bs, StringSet.add (ps, Primitive.toString p))  
147    
148          val (smlinfos, stableinfos, prims) =          val (smlinfos, stableinfos) =
149              SymbolMap.foldl add              SymbolMap.foldl add (SmlInfoSet.empty, StableSet.empty) loadmap0
                   (SmlInfoSet.empty, StableSet.empty, StringSet.empty)  
                   loadmap0  
150    
151          (* now we can easily find out whether a node has been picked... *)          (* now we can easily find out whether a node has been picked... *)
152          fun isPicked (((_, DG.SB_SNODE (DG.SNODE n)), _), _) =          fun isPicked (((_, DG.SB_SNODE (DG.SNODE n)), _), _) =
153              SmlInfoSet.member (smlinfos, #smlinfo n)              SmlInfoSet.member (smlinfos, #smlinfo n)
154            | isPicked (((_, DG.SB_BNODE (DG.BNODE n, _)), _), _) =            | isPicked (((_, DG.SB_BNODE (DG.BNODE n, _)), _), _) =
155              StableSet.member (stableinfos, #bininfo n)              StableSet.member (stableinfos, #bininfo n)
           | isPicked (((_, DG.SB_BNODE (DG.PNODE p, _)), _), _) =  
             StringSet.member (prims, Primitive.toString p)  
156    
157          val loadmap = SymbolMap.filter isPicked pend          val loadmap = SymbolMap.filter isPicked pend
158          val noloadmap = SymbolMap.filter (not o isPicked) pend          val noloadmap = SymbolMap.filter (not o isPicked) pend

Legend:
Removed from v.505  
changed lines
  Added in v.537

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