module GHC.Unit.External
( ExternalPackageState (..)
, EpsStats(..)
, addEpsInStats
, PackageTypeEnv
, PackageIfaceTable
, PackageInstEnv
, PackageFamInstEnv
, PackageRuleBase
, PackageCompleteMatches
, emptyPackageIfaceTable
)
where
import GHC.Prelude
import GHC.Unit
import GHC.Unit.Module.ModIface
import GHC.Core ( RuleBase )
import GHC.Core.FamInstEnv
import GHC.Core.InstEnv ( InstEnv )
import GHC.Types.Annotations ( AnnEnv )
import GHC.Types.CompleteMatch
import GHC.Types.TypeEnv
import GHC.Types.Unique.DSet
type PackageTypeEnv = TypeEnv
type PackageRuleBase = RuleBase
type PackageInstEnv = InstEnv
type PackageFamInstEnv = FamInstEnv
type PackageAnnEnv = AnnEnv
type PackageCompleteMatches = CompleteMatches
type PackageIfaceTable = ModuleEnv ModIface
emptyPackageIfaceTable :: PackageIfaceTable
emptyPackageIfaceTable :: PackageIfaceTable
emptyPackageIfaceTable = PackageIfaceTable
forall a. ModuleEnv a
emptyModuleEnv
data ExternalPackageState
= EPS {
ExternalPackageState -> ModuleNameEnv ModuleNameWithIsBoot
eps_is_boot :: !(ModuleNameEnv ModuleNameWithIsBoot),
ExternalPackageState -> PackageIfaceTable
eps_PIT :: !PackageIfaceTable,
ExternalPackageState -> InstalledModuleEnv (UniqDSet ModuleName)
eps_free_holes :: InstalledModuleEnv (UniqDSet ModuleName),
ExternalPackageState -> PackageTypeEnv
eps_PTE :: !PackageTypeEnv,
ExternalPackageState -> PackageInstEnv
eps_inst_env :: !PackageInstEnv,
ExternalPackageState -> PackageFamInstEnv
eps_fam_inst_env :: !PackageFamInstEnv,
ExternalPackageState -> PackageRuleBase
eps_rule_base :: !PackageRuleBase,
ExternalPackageState -> PackageAnnEnv
eps_ann_env :: !PackageAnnEnv,
ExternalPackageState -> PackageCompleteMatches
eps_complete_matches :: !PackageCompleteMatches,
ExternalPackageState -> ModuleEnv PackageFamInstEnv
eps_mod_fam_inst_env :: !(ModuleEnv FamInstEnv),
ExternalPackageState -> EpsStats
eps_stats :: !EpsStats
}
data EpsStats = EpsStats { EpsStats -> Int
n_ifaces_in
, EpsStats -> Int
n_decls_in, EpsStats -> Int
n_decls_out
, EpsStats -> Int
n_rules_in, EpsStats -> Int
n_rules_out
, EpsStats -> Int
n_insts_in, EpsStats -> Int
n_insts_out :: !Int }
addEpsInStats :: EpsStats -> Int -> Int -> Int -> EpsStats
addEpsInStats :: EpsStats -> Int -> Int -> Int -> EpsStats
addEpsInStats EpsStats
stats Int
n_decls Int
n_insts Int
n_rules
= EpsStats
stats { n_ifaces_in :: Int
n_ifaces_in = EpsStats -> Int
n_ifaces_in EpsStats
stats Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1
, n_decls_in :: Int
n_decls_in = EpsStats -> Int
n_decls_in EpsStats
stats Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n_decls
, n_insts_in :: Int
n_insts_in = EpsStats -> Int
n_insts_in EpsStats
stats Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n_insts
, n_rules_in :: Int
n_rules_in = EpsStats -> Int
n_rules_in EpsStats
stats Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n_rules }