summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Desugar.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthew.pickering@tweag.io>2018-05-27 11:57:27 -0400
committerBen Gamari <ben@smart-cactus.org>2018-05-30 18:06:33 -0400
commit1d1e2b77fdc2babdf4fff72b9120c6831e7b422f (patch)
tree088af3cf628ef34181ec90434d55d5f1b05ead41 /compiler/deSugar/Desugar.hs
parente0b44e2eccd4053852b6c4c3de75a714301ec080 (diff)
downloadhaskell-1d1e2b77fdc2babdf4fff72b9120c6831e7b422f.tar.gz
Implement "An API for deciding whether plugins should cause recompilation"
This patch implements the API proposed as pull request #108 for plugin authors to influence the recompilation checker. It adds a new field to a plugin which computes a `FingerPrint`. This is recorded in interface files and if it changes then we recompile the module. There are also helper functions such as `purePlugin` and `impurePlugin` for constructing plugins which have simple recompilation semantics but in general, an author can compute a hash as they wish. Fixes #12567 and #7414 https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/002 2-plugin-recompilation.rst Reviewers: bgamari, ggreif Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #7414, #12567 Differential Revision: https://phabricator.haskell.org/D4366
Diffstat (limited to 'compiler/deSugar/Desugar.hs')
-rw-r--r--compiler/deSugar/Desugar.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs
index e8ce029b04..ce12a5631a 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/deSugar/Desugar.hs
@@ -66,6 +66,7 @@ import OrdList
import Data.List
import Data.IORef
import Control.Monad( when )
+import Plugins ( LoadedPlugin(..) )
{-
************************************************************************
@@ -169,7 +170,10 @@ deSugar hsc_env
; endPassIO hsc_env print_unqual CoreDesugarOpt ds_binds ds_rules_for_imps
; let used_names = mkUsedNames tcg_env
- ; deps <- mkDependencies tcg_env
+ pluginModules =
+ map lpModule (plugins (hsc_dflags hsc_env))
+ ; deps <- mkDependencies (thisInstalledUnitId (hsc_dflags hsc_env))
+ pluginModules tcg_env
; used_th <- readIORef tc_splice_used
; dep_files <- readIORef dependent_files