[Git][ghc/ghc][wip/compact-iface] Turn off compacting
Matthew Pickering
gitlab at gitlab.haskell.org
Wed Mar 25 12:04:42 UTC 2020
Matthew Pickering pushed to branch wip/compact-iface at Glasgow Haskell Compiler / GHC
Commits:
b7ea9ba3 by Matthew Pickering at 2020-03-25T12:04:28+00:00
Turn off compacting
- - - - -
1 changed file:
- compiler/GHC/Driver/Types.hs
Changes:
=====================================
compiler/GHC/Driver/Types.hs
=====================================
@@ -625,22 +625,28 @@ type HomePackageTable = DModuleNameEnv HomeModInfo
data CompactRegion = forall a . CompactRegion (Compact a) | EmptyRegion
-- | Helps us find information about modules in the imported packages
-data PackageIfaceTable = PackageIfaceTable CompactRegion (ModuleEnv ModIface)
+data PackageIfaceTable = PackageIfaceTable (Maybe CompactRegion) (ModuleEnv ModIface)
-- Domain = modules in the imported packages
-- | Constructs an empty HomePackageTable
emptyHomePackageTable :: HomePackageTable
emptyHomePackageTable = emptyUDFM
+-- | Constructs an empty PackageIfaceTable
+emptyPackageIfaceTableWithCompact :: Maybe CompactRegion -> PackageIfaceTable
+emptyPackageIfaceTableWithCompact c = PackageIfaceTable c emptyModuleEnv
+
-- | Constructs an empty PackageIfaceTable
emptyPackageIfaceTable :: PackageIfaceTable
-emptyPackageIfaceTable = PackageIfaceTable EmptyRegion emptyModuleEnv
+emptyPackageIfaceTable = emptyPackageIfaceTableWithCompact Nothing
lookupPIT :: PackageIfaceTable -> Module -> Maybe ModIface
lookupPIT (PackageIfaceTable _ pit) m = lookupModuleEnv pit m
extendPIT :: PackageIfaceTable -> Module -> ModIface -> IO PackageIfaceTable
-extendPIT (PackageIfaceTable comp pit) m mi = do
+extendPIT (PackageIfaceTable Nothing pit) m mi =
+ return $ PackageIfaceTable Nothing (extendModuleEnv pit m mi)
+extendPIT (PackageIfaceTable (Just comp) pit) m mi = do
let raw_iface = forgetModIfaceCaches mi
compact_region <- case comp of
CompactRegion c -> do
@@ -648,7 +654,7 @@ extendPIT (PackageIfaceTable comp pit) m mi = do
EmptyRegion -> do
compact raw_iface
let compacted_iface = initModIfaceCaches $ getCompact compact_region
- return (PackageIfaceTable (CompactRegion compact_region) (extendModuleEnv pit m compacted_iface))
+ return (PackageIfaceTable (Just (CompactRegion compact_region)) (extendModuleEnv pit m compacted_iface))
extendPITFake :: PackageIfaceTable -> Module -> PackageIfaceTable
extendPITFake (PackageIfaceTable c pit) mod =
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b7ea9ba3fa75ad86b8220f92b51f60c24d737069
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b7ea9ba3fa75ad86b8220f92b51f60c24d737069
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/20200325/6c3aff9c/attachment-0001.html>
More information about the ghc-commits
mailing list