[Git][ghc/ghc][wip/romes/graph-compact-easy] 3 commits: whitespace fixes
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Tue Dec 3 13:39:45 UTC 2024
Rodrigo Mesquita pushed to branch wip/romes/graph-compact-easy at Glasgow Haskell Compiler / GHC
Commits:
94f3aab2 by Rodrigo Mesquita at 2024-12-03T11:19:27+00:00
whitespace fixes
- - - - -
eda1b671 by Rodrigo Mesquita at 2024-12-03T13:39:29+00:00
clean up
- - - - -
a2778de6 by Rodrigo Mesquita at 2024-12-03T13:39:37+00:00
fix
- - - - -
3 changed files:
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Home/Graph.hs
- ghc/GHCi/Leak.hs
Changes:
=====================================
compiler/GHC/Unit/Env.hs
=====================================
@@ -23,15 +23,15 @@
-- ┌────────────────┐┌────────────────────┐┌───────────┐
-- │HomePackageTable││ExternalPackageState││ModuleGraph│
-- └┬───────────────┘└┬───────────────────┘└┬──────────┘
--- ┌▽────────────┐ │ │
--- │HomeUnitGraph│ │ │
--- └┬────────────┘ │ │
--- ┌▽─────────────────▽┐ │
--- │UnitEnv │ │
--- └┬──────────────────┘ │
--- ┌▽───────────────────────────────────────▽┐
--- │HscEnv │
--- └─────────────────────────────────────────┘
+-- ┌▽────────────┐ │ │
+-- │HomeUnitGraph│ │ │
+-- └┬────────────┘ │ │
+-- ┌▽─────────────────▽┐ │
+-- │UnitEnv │ │
+-- └┬──────────────────┘ │
+-- ┌▽───────────────────────────────────────▽┐
+-- │HscEnv │
+-- └─────────────────────────────────────────┘
-- @
--
-- The 'UnitEnv' references both the 'HomeUnitGraph' (with all the home unit
@@ -46,44 +46,18 @@ module GHC.Unit.Env
, unsafeGetHomeUnit
, updateHug
-- * Unit Env helper functions
- -- , ue_units
, ue_currentHomeUnitEnv
-
- -- Stuff used by Backpack could be simplifeid ehre
- -- , ue_unit_dbs
- -- , ue_all_home_unit_ids
, ue_hpt
-
, ue_setActiveUnit
, ue_currentUnit
, ue_findHomeUnitEnv
, ue_unitHomeUnit_maybe
, ue_updateHomeUnitEnv
- -- , ue_unitHomeUnit
- -- , ue_unitFlags
- -- * HomeUnitEnv
+
+ -- * HUG Re-export
, HomeUnitGraph
, HomeUnitEnv (..)
- -- , mkHomeUnitEnv
- -- , lookupHugByModule
- -- , hugElts
- -- , lookupHug
- -- , addHomeModInfoToHug
- -- * UnitEnvGraph
- -- , UnitEnvGraph (..)
- -- , UnitEnvGraphKey
- -- , unitEnv_new
- -- , unitEnv_singleton
- -- , unitEnv_map
- -- , unitEnv_lookup_maybe
- -- , unitEnv_lookup
- -- , unitEnv_keys
- -- , unitEnv_elts
- -- , unitEnv_hpts
- -- , unitEnv_foldWithKey
- -- , unitEnv_mapWithKey
-
-- * Invariants
, assertUnitEnvInvariant
-- * Preload units info
@@ -92,9 +66,9 @@ module GHC.Unit.Env
-- * Home Module functions
, isUnitEnvInstalledModule
- --------------------------------------------------------------------------------
+ --------------------------------------------------------------------------------
-- WIP above
- --------------------------------------------------------------------------------
+ --------------------------------------------------------------------------------
-- * Operations on the UnitEnv
, renameUnitId
@@ -114,9 +88,9 @@ module GHC.Unit.Env
-- ** Reachability
, transitiveHomeDeps
- --------------------------------------------------------------------------------
+ --------------------------------------------------------------------------------
-- Harder queries for the whole UnitEnv
- --------------------------------------------------------------------------------
+ --------------------------------------------------------------------------------
-- ** Instances, rules, type fams, annotations, etc..
--
@@ -287,10 +261,6 @@ isUnitEnvInstalledModule ue m = maybe False (`isHomeInstalledModule` m) hu
-- Operations on arbitrary elements of the home unit graph
-- -------------------------------------------------------
--- ue_findHomeUnitEnv_maybe :: UnitId -> UnitEnv -> Maybe HomeUnitEnv
--- ue_findHomeUnitEnv_maybe uid e =
--- unitEnv_lookup_maybe uid (ue_home_unit_graph e)
-
ue_findHomeUnitEnv :: HasDebugCallStack => UnitId -> UnitEnv -> HomeUnitEnv
ue_findHomeUnitEnv uid e = case HUG.lookupHugUnit uid (ue_home_unit_graph e) of
Nothing -> pprPanic "Unit unknown to the internal unit environment"
@@ -362,12 +332,6 @@ ue_unitHomeUnit_maybe :: UnitId -> UnitEnv -> Maybe HomeUnit
ue_unitHomeUnit_maybe uid ue_env =
HUG.homeUnitEnv_home_unit =<< HUG.lookupHugUnit uid (ue_home_unit_graph ue_env)
--- ue_unitHomeUnit :: UnitId -> UnitEnv -> HomeUnit
--- ue_unitHomeUnit uid ue_env = homeUnitEnv_unsafeHomeUnit $ ue_findHomeUnitEnv uid ue_env
-
--- ue_all_home_unit_ids :: UnitEnv -> Set.Set UnitId
--- ue_all_home_unit_ids = unitEnv_keys . ue_home_unit_graph
-
-- -------------------------------------------------------
-- Query and modify the currently active unit
-- -------------------------------------------------------
=====================================
compiler/GHC/Unit/Home/Graph.hs
=====================================
@@ -272,7 +272,7 @@ lookupHug hug uid mod = do
case unitEnv_lookup_maybe uid hug of
-- Really, here we want "lookup HPT" rather than unitEnvLookup
Nothing -> pure Nothing
- Just hue -> lookupHpt (homeUnitEnv_hpt hue) mod
+ Just hue -> lookupHpt (homeUnitEnv_hpt hue) mod
-- | Lookup the 'HomeModInfo' of a 'Module' in the 'HomeUnitGraph' (via the 'HomePackageTable' of the corresponding unit)
lookupHugByModule :: Module -> HomeUnitGraph -> IO (Maybe HomeModInfo)
=====================================
ghc/GHCi/Leak.hs
=====================================
@@ -40,7 +40,7 @@ data LeakModIndicators = LeakModIndicators
-- the currently loaded modules.
getLeakIndicators :: HscEnv -> IO LeakIndicators
getLeakIndicators hsc_env =
- fmap LeakIndicators $
+ fmap LeakIndicators $ do
hpt <- readIORef $ hptInternalTableRef $ hsc_HPT hsc_env
forM (eltsUDFM hpt) $ \hmi at HomeModInfo{..} -> do
leakMod <- mkWeakPtr hmi Nothing
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b5d0b857568123781e0369445b90ed70af8e3324...a2778de6e37d39fcc701c125ac18bbcdf1fc5c84
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b5d0b857568123781e0369445b90ed70af8e3324...a2778de6e37d39fcc701c125ac18bbcdf1fc5c84
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/20241203/766eee3f/attachment-0001.html>
More information about the ghc-commits
mailing list