[Git][ghc/ghc][wip/romes/graph-compact-easy] drop incorrect asymptotics
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Mon Jan 6 18:09:46 UTC 2025
Rodrigo Mesquita pushed to branch wip/romes/graph-compact-easy at Glasgow Haskell Compiler / GHC
Commits:
2c6b73ea by Rodrigo Mesquita at 2025-01-06T18:09:39+00:00
drop incorrect asymptotics
- - - - -
1 changed file:
- compiler/GHC/Unit/Home/PackageTable.hs
Changes:
=====================================
compiler/GHC/Unit/Home/PackageTable.hs
=====================================
@@ -35,7 +35,7 @@
--
-- Or, do you really need a function to traverse all modules in the HPT? It is
-- often better to keep the computation internal to this module, such as in
--- 'hptCollectDependencies'...
+-- 'hptCollectObjects'...
module GHC.Unit.Home.PackageTable
(
HomePackageTable(..)
@@ -168,8 +168,6 @@ lookupHptByModule hpt mod
-- the HPT is created for that module name.
-- When the module already has an entry, inserting a new one entry in the HPT
-- will always overwrite the existing entry for that module.
---
--- $O(1)$
addHomeModInfoToHpt :: HomeModInfo -> HomePackageTable -> IO ()
addHomeModInfoToHpt hmi hpt = addToHpt hpt (moduleName (mi_module (hm_iface hmi))) hmi
@@ -202,8 +200,6 @@ addListToHpt hpt = mapM_ (uncurry (addToHpt hpt))
-- | Get all 'CompleteMatches' (arising from COMPLETE pragmas) present in all
-- modules from this unit's HPT.
---
--- $O(n)$ in the number of modules.
hptCompleteSigs :: HomePackageTable -> IO CompleteMatches
hptCompleteSigs = concatHpt (md_complete_matches . hm_details)
@@ -212,8 +208,6 @@ hptCompleteSigs = concatHpt (md_complete_matches . hm_details)
-- Used in @tcRnImports@, to select the instances that are in the
-- transitive closure of imports from the currently compiled module.
-- ROMES:TODO: wait what?
---
--- $O(n)$ in the number of modules.
hptAllInstances :: HomePackageTable -> IO (InstEnv, [FamInst])
hptAllInstances hpt = do
hits <- flip concatHpt hpt $ \mod_info -> do
@@ -223,8 +217,6 @@ hptAllInstances hpt = do
return (foldl' unionInstEnv emptyInstEnv insts, concat famInsts)
-- | Find all the family instance declarations from the HPT
---
--- $O(n)$ in the number of modules.
hptAllFamInstances :: HomePackageTable -> IO (ModuleEnv FamInstEnv)
hptAllFamInstances = fmap mkModuleEnv . concatHpt (\hmi -> [(hmiModule hmi, hmiFamInstEnv hmi)])
where
@@ -233,8 +225,6 @@ hptAllFamInstances = fmap mkModuleEnv . concatHpt (\hmi -> [(hmiModule hmi, hmiF
. md_fam_insts . hm_details
-- | All annotations from the HPT
---
--- $O(n)$ in the number of modules.
hptAllAnnotations :: HomePackageTable -> IO AnnEnv
hptAllAnnotations = fmap mkAnnEnv . concatHpt (md_anns . hm_details)
@@ -245,8 +235,6 @@ hptAllAnnotations = fmap mkAnnEnv . concatHpt (md_anns . hm_details)
-- | Collect the immediate dependencies of all modules in the HPT into a Set.
-- The immediate dependencies are given by the iface as @'dep_direct_pkgs' . 'mi_deps'@.
---
--- $O(n)$ in the number of modules in the HPT.
hptCollectDependencies :: HomePackageTable -> IO (Set.Set UnitId)
hptCollectDependencies HPT{table} = do
hpt <- readIORef table
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2c6b73ea0ba01c209c82cb517e4f0f22ca6984fb
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2c6b73ea0ba01c209c82cb517e4f0f22ca6984fb
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/20250106/30fce982/attachment-0001.html>
More information about the ghc-commits
mailing list