summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-12-11 18:36:00 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-12 23:25:02 -0500
commitefb6a30f0b70948ba51497bf2831e009ec6e1378 (patch)
treed39e605b08ddda0c44f8de95ccf9adb65a0af7ae /compiler/main
parentf0eb404e1b5b296048da3d0b9efe42d5aa9e0f1d (diff)
downloadhaskell-efb6a30f0b70948ba51497bf2831e009ec6e1378.tar.gz
Fix recompilation checking of pure plugins
Previously when switching from using a Plugin with `RecompMaybe`/`ForceRecompile` in `pluginRecompile` to a Plugin with `NoForceRecompile` GHC would never even consider recompiling. However the previously active plugin could have modified the compilation output so we should recompile. Test Plan: validate Reviewers: bgamari, mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15858 Differential Revision: https://phabricator.haskell.org/D5299
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/DynFlags.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index be347d9367..02ad366338 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2590,6 +2590,12 @@ setComponentId s d =
addPluginModuleName :: String -> DynFlags -> DynFlags
addPluginModuleName name d = d { pluginModNames = (mkModuleName name) : (pluginModNames d) }
+clearPluginModuleNames :: DynFlags -> DynFlags
+clearPluginModuleNames d =
+ d { pluginModNames = []
+ , pluginModNameOpts = []
+ , cachedPlugins = [] }
+
addPluginModuleNameOption :: String -> DynFlags -> DynFlags
addPluginModuleNameOption optflag d = d { pluginModNameOpts = (mkModuleName m, option) : (pluginModNameOpts d) }
where (m, rest) = break (== ':') optflag
@@ -3488,6 +3494,7 @@ dynamic_flags_deps = [
------ Plugin flags ------------------------------------------------
, make_ord_flag defGhcFlag "fplugin-opt" (hasArg addPluginModuleNameOption)
, make_ord_flag defGhcFlag "fplugin" (hasArg addPluginModuleName)
+ , make_ord_flag defGhcFlag "fclear-plugins" (noArg clearPluginModuleNames)
, make_ord_flag defGhcFlag "ffrontend-opt" (hasArg addFrontendPluginOption)
------ Optimisation flags ------------------------------------------