summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcgibbard <cgibbard@gmail.com>2020-07-29 12:39:22 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-30 07:11:02 -0400
commit502de55676a38572db60848c13392f5f115e1c8a (patch)
tree8847159a6e913776de86df9bfa8cd9eb7bde81fa
parent6c68a84254d70280e2dc73485f361787a3503850 (diff)
downloadhaskell-502de55676a38572db60848c13392f5f115e1c8a.tar.gz
Add haddock comment for unfilteredEdges
and move the note about drop_hs_boot_nodes into it.
-rw-r--r--compiler/GHC/Driver/Make.hs17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 0344c5ed97..74c3f9efa8 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -1983,23 +1983,22 @@ summaryNodeKey = node_key
summaryNodeSummary :: SummaryNode -> ModSummary
summaryNodeSummary = node_payload
+-- | Collect the immediate dependencies of a module from its ModSummary,
+-- optionally avoiding hs-boot dependencies.
+-- If the drop_hs_boot_nodes flag is False, and if this is a .hs and there is
+-- an equivalent .hs-boot, add a link from the former to the latter. This
+-- has the effect of detecting bogus cases where the .hs-boot depends on the
+-- .hs, by introducing a cycle. Additionally, it ensures that we will always
+-- process the .hs-boot before the .hs, and so the HomePackageTable will always
+-- have the most up to date information.
unfilteredEdges :: Bool -> ModSummary -> [ModuleNameWithIsBoot]
unfilteredEdges drop_hs_boot_nodes ms =
(flip GWIB hs_boot_key . unLoc <$> ms_home_srcimps ms) ++
(flip GWIB NotBoot . unLoc <$> ms_home_imps ms) ++
[ GWIB (ms_mod_name ms) IsBoot
| not $ drop_hs_boot_nodes || ms_hsc_src ms == HsBootFile
- -- see [boot-edges] below
]
where
- -- [boot-edges] if this is a .hs and there is an equivalent
- -- .hs-boot, add a link from the former to the latter. This
- -- has the effect of detecting bogus cases where the .hs-boot
- -- depends on the .hs, by introducing a cycle. Additionally,
- -- it ensures that we will always process the .hs-boot before
- -- the .hs, and so the HomePackageTable will always have the
- -- most up to date information.
-
-- Drop hs-boot nodes by using HsSrcFile as the key
hs_boot_key | drop_hs_boot_nodes = NotBoot -- is regular mod or signature
| otherwise = IsBoot