summaryrefslogtreecommitdiff
path: root/compiler/GHC.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-13 14:50:29 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-17 14:06:08 -0400
commit65bf3992aebb3c08f0c4e13a3fb89dd5620015a9 (patch)
tree829b10ecd01913dc32710182f0f73519e2f9414a /compiler/GHC.hs
parentc9922a8e4d598f1c6a048305ca58d0ecf34d6776 (diff)
downloadhaskell-65bf3992aebb3c08f0c4e13a3fb89dd5620015a9.tar.gz
ghci: Explicitly store and restore interface file cache
In the old days the old HPT was used as an interface file cache when using ghci. The HPT is a `ModuleEnv HomeModInfo` and so if you were using hs-boot files then the interface file from compiling the .hs file would be present in the cache but not the hi-boot file. This used to be ok, because the .hi file used to just be a better version of the .hi-boot file, with more information so it was fine to reuse it. Now the source hash of a module is kept track of in the interface file and the source hash for the .hs and .hs-boot file are correspondingly different so it's no longer safe to reuse an interface file. I took the decision to move the cache management of interface files to GHCi itself, and provide an API where `load` can be provided with a list of interface files which can be used as a cache. An alternative would be to manage this cache somewhere in the HscEnv but it seemed that an API user should be responsible for populating and suppling the cache rather than having it managed implicitly. Fixes #20217
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r--compiler/GHC.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index 0488ccad11..ad584905a4 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -53,7 +53,7 @@ module GHC (
-- * Loading\/compiling the program
depanal, depanalE,
- load, LoadHowMuch(..), InteractiveImport(..),
+ load, loadWithCache, LoadHowMuch(..), InteractiveImport(..),
SuccessFlag(..), succeeded, failed,
defaultWarnErrLogger, WarnErrLogger,
workingDirectoryChanged,