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

Diff of /sml/trunk/src/cm/depend/build.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 203  Line 203 
203                  fun dontcomplain s = DE.EMPTY                  fun dontcomplain s = DE.EMPTY
204                  fun lookfar () =                  fun lookfar () =
205                      case SM.find (imports, s) of                      case SM.find (imports, s) of
206                          SOME (farn, e) => (globalImport farn;                          SOME (farnth, e, _) => (globalImport (farnth ());
207                                             look dontcomplain e s)                                             look dontcomplain e s)
208                        | NONE =>                        | NONE =>
209                              (* We could complain here about an undefined                              (* We could complain here about an undefined
# Line 242  Line 242 
242           * to be updated accordingly *)           * to be updated accordingly *)
243          fun doSmlFile i = ignore (getResult (i, []))          fun doSmlFile i = ignore (getResult (i, []))
244    
         (* converting smlinfos to sbnodes * env *)  
         fun i2sbn i = let  
             val (sn, e) = valOf (valOf (fetch i))  
         in  
             (DG.SB_SNODE sn, e)  
         end  
   
245          (* run the analysis *)          (* run the analysis *)
246          val _ = app doSmlFile smlfiles          val _ = app doSmlFile smlfiles
247    
248          (* We add NONE as link path info here.  In general, this is          (* Invert the "localdefs" map so that each smlinfo is mapped to the
249           * not always the correct info, but the correct info will           * corresponding _set_ of symbols: *)
250           * become available upon _import_ (and not now, during export). *)          local
251          fun addDummyFilt (sbn, e) = ((NONE, sbn), e)              fun add (sy, i, m) =
252                    case SmlInfoMap.find (m, i) of
253                        NONE => SmlInfoMap.insert (m, i, SymbolSet.singleton sy)
254                      | SOME ss => SmlInfoMap.insert (m, i, SymbolSet.add (ss, sy))
255            in
256                val ilocaldefs = SymbolMap.foldli add SmlInfoMap.empty localdefs
257            end
258    
259            fun addDummyFilt i = let
260                val (sn, e) = valOf (valOf (fetch i))
261                val sbn = DG.SB_SNODE sn
262                val fsbn = (NONE, sbn)
263            in
264                (* We also thunkify the fsbn so that the result is an impexp. *)
265                (fn () => fsbn, e, valOf (SmlInfoMap.find (ilocaldefs, i)))
266            end
267    
268          (* First we make a map of all locally defined symbols to          (* First we make a map of all locally defined symbols to
269           * the local "far sb node"           * the local "far sb node"
# Line 263  Line 271 
271           * This makes it consistent with the current state           * This makes it consistent with the current state
272           * of "imports" and "gimports" where there can be filters, but           * of "imports" and "gimports" where there can be filters, but
273           * where those filters are not yet strengthened according to fopt *)           * where those filters are not yet strengthened according to fopt *)
274          val localmap = SM.map (addDummyFilt o i2sbn) localdefs          val localmap = SM.map addDummyFilt localdefs
275    
276          val exports =          val exports =
277              case fopt of              case fopt of
# Line 279  Line 287 
287                       * They can be taken from either localmap or else from                       * They can be taken from either localmap or else from
288                       * imports.  In either case, it is necessary to strengthen                       * imports.  In either case, it is necessary to strengthen
289                       * the filter attached to each node. *)                       * the filter attached to each node. *)
290                      fun strengthen ((fopt', sbn), e) = let                      fun strengthen (nth, e, allsyms) = let
291                            val (fopt', sbn) = nth ()
292                          val new_fopt =                          val new_fopt =
293                              case fopt' of                              case fopt' of
294                                  NONE => fopt                                  NONE => fopt
295                                | SOME ss' => SOME (SS.intersection (ss, ss'))                                | SOME ss' => SOME (SS.intersection (ss, ss'))
296                            fun nth' () = (new_fopt, sbn)
297                      in                      in
298                          ((new_fopt, sbn), DE.FILTER (ss, e))                          (nth', DE.FILTER (ss, e), SS.intersection (allsyms,ss))
299                      end                      end
300                      val availablemap = SM.unionWith #1 (localmap, imports)                      val availablemap = SM.unionWith #1 (localmap, imports)
301                      fun addNodeFor (s, m) =                      fun addNodeFor (s, m) =

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