summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcgibbard <cgibbard@gmail.com>2020-07-29 12:39:22 -0400
committercgibbard <cgibbard@gmail.com>2020-07-29 12:39:22 -0400
commita15fa25ec3c152a3dcf2b78e62a5e2b2cb371254 (patch)
tree07413e57219ffe73ab6f137324828bcf91ba6ba3
parentf5f76b7b3174dcea394961262609c18e3fd26545 (diff)
downloadhaskell-wip/keep-going-hs-boot.tar.gz
Add haddock comment for unfilteredEdgeswip/keep-going-hs-boot
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 7ee9035ad0..376fa03a71 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -1981,23 +1981,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