[Git][ghc/ghc][wip/keep-going-hs-boot] Add haddock comment for unfilteredEdges

cgibbard gitlab at gitlab.haskell.org
Wed Jul 29 16:39:23 UTC 2020



cgibbard pushed to branch wip/keep-going-hs-boot at Glasgow Haskell Compiler / GHC


Commits:
a15fa25e by cgibbard at 2020-07-29T12:39:22-04:00
Add haddock comment for unfilteredEdges
and move the note about drop_hs_boot_nodes into it.
- - - - -


1 changed file:

- compiler/GHC/Driver/Make.hs


Changes:

=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a15fa25ec3c152a3dcf2b78e62a5e2b2cb371254

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a15fa25ec3c152a3dcf2b78e62a5e2b2cb371254
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200729/d0d6a6f8/attachment-0001.html>


More information about the ghc-commits mailing list