Hannes Siebenhandl pushed to branch wip/fendor/external-unit-db-cache at Glasgow Haskell Compiler / GHC Commits: 56161185 by fendor at 2026-07-22T11:09:19+02:00 Fixup: Add graph showing the relation between external Unit types - - - - - 1 changed file: - compiler/GHC/Unit/External/Index.hs Changes: ===================================== compiler/GHC/Unit/External/Index.hs ===================================== @@ -1,3 +1,45 @@ +-- | The 'UnitIndex' is a 'UnitEnv' wide data structure that shares +-- external unit information across the 'UnitState' of all home units +-- (e.g., 'HomeUnitEnv') in a particular 'UnitEnv'. +-- +-- It caches already read unit databases, all processed 'UnitInfo's and +-- the 'WireMap'. +-- +-- This module is meant to be imported as @Index@. +-- +-- A short overview of how the different types here related to 'UnitState', 'UnitEnv' +-- and the 'HomeUnitEnv'. +-- +-- ┌─────────┐ +-- │ UnitEnv │ +-- └────┬────┘ +-- ├───────────────────────┐ +-- │ │ +-- ┌────▼──────┐ ┌─────▼─────┐ +-- │HomeUnitEnv│ │ UnitIndex ├────────────────┐ +-- └────┬──────┘ └───────────┘ │ +-- │ │ +-- │ Reads cached unit DBs │ +-- ┌────▼──────┐ ┌─────────────────────┐ │ +-- │ UnitState ├──────────>ExternalUnitDatabases◄──────┤ +-- └────┬──┬───┘ └─────────────────────┘ │ +-- │ └───────────────────────┐ │ +-- │ Writes new UnitInfos │ │ +-- │ during initialisation │ │ +-- ┌────▼────────┐ ┌────────v──────────┐ │ +-- │ UnitInfoMap │ │ GlobalUnitInfoMap ◄────────┘ +-- └────┬────────┘ └────────^──────────┘ +-- │ │ +-- └──────────────────────────┘ +-- UnitInfoMap references +-- GlobalUnitInfoMap values +-- (All UnitInfos are shared) +-- +-- Open arrow @A ───> B@: A uses B. +-- Closed arrow @A ◄─── B@: A is a field of B. +-- +-- Also, see Note [Sharing 'UnitInfo's across the 'UnitEnv'] for more technical discussion +-- about sharing 'UnitInfo's. module GHC.Unit.External.Index ( -- * The 'UnitIndexCache'. -- A mutable wrapper around 'UnitIndex' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56161185735edbff60727a62c8b8f690... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56161185735edbff60727a62c8b8f690... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Hannes Siebenhandl (@fendor)