52 |
case StableMap.find (!stablemap, i) of |
case StableMap.find (!stablemap, i) of |
53 |
SOME s' => StringSet.union (s, s') |
SOME s' => StringSet.union (s, s') |
54 |
| NONE => let |
| NONE => let |
55 |
val gs = foldl fbn empty globalimports |
val gs = foldl bglobi empty globalimports |
56 |
val ls = foldl bn gs localimports |
val ls = foldl bloci gs localimports |
57 |
val s' = check (BinInfo.share i, BinInfo.describe i, ls, |
val s' = check (BinInfo.share i, BinInfo.describe i, ls, |
58 |
BinInfo.error i) |
BinInfo.error i) |
59 |
in |
in |
61 |
StringSet.union (s, s') |
StringSet.union (s, s') |
62 |
end |
end |
63 |
|
|
64 |
|
and bglobi ((n, _), s) = fbn (n, s) |
65 |
|
and bloci ((n, _), s) = bn (n, s) |
66 |
|
|
67 |
and fbn ((_, n), s) = bn (n, s) |
and fbn ((_, n), s) = bn (n, s) |
68 |
|
|
69 |
fun sn (DG.SNODE { smlinfo = i, localimports, globalimports }, s) = |
fun sn (DG.SNODE n, s) = let |
70 |
|
val { smlinfo = i, localimports, globalimports, ... } = n |
71 |
|
in |
72 |
case SmlInfoMap.find (!smlmap, i) of |
case SmlInfoMap.find (!smlmap, i) of |
73 |
SOME s' => StringSet.union (s, s') |
SOME s' => StringSet.union (s, s') |
74 |
| NONE => let |
| NONE => let |
75 |
val gs = foldl fsbn empty globalimports |
val gs = foldl globi empty globalimports |
76 |
val ls = foldl sn gs localimports |
val ls = foldl loci gs localimports |
77 |
val s' = check (SmlInfo.share i, SmlInfo.descr i, ls, |
val s' = check (SmlInfo.share i, SmlInfo.descr i, ls, |
78 |
SmlInfo.error gp i) |
SmlInfo.error gp i) |
79 |
in |
in |
80 |
smlmap := SmlInfoMap.insert (!smlmap, i, s'); |
smlmap := SmlInfoMap.insert (!smlmap, i, s'); |
81 |
StringSet.union (s, s') |
StringSet.union (s, s') |
82 |
end |
end |
83 |
|
end |
84 |
|
|
85 |
|
and loci ((n, _), s) = sn (n, s) |
86 |
|
and globi ((n, _), s) = fsbn (n, s) |
87 |
|
|
88 |
and sbn (DG.SB_BNODE n, s) = bn (n, s) |
and sbn (DG.SB_BNODE n, s) = bn (n, s) |
89 |
| sbn (DG.SB_SNODE n, s) = sn (n, s) |
| sbn (DG.SB_SNODE n, s) = sn (n, s) |