summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2023-03-27 13:20:26 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2023-05-05 09:43:40 +0100
commitaf51225b02bc2e45184df685e87d8be74936db6e (patch)
tree7a9acaf29e5733bd85dfc94b6261e5f2d3b5efb9 /compiler/GHC/Driver
parentf6d990aebf50015f5ea0b3e40c19f868a9124661 (diff)
downloadhaskell-wip/plugin-init.tar.gz
docs: Add Note [Timing of plugin initialization]wip/plugin-init
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r--compiler/GHC/Driver/Make.hs1
-rw-r--r--compiler/GHC/Driver/Pipeline.hs1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 2cc762b9cd..b7bc05f74a 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -696,6 +696,7 @@ load' :: GhcMonad m => Maybe ModIfaceCache -> LoadHowMuch -> Maybe Messager -> M
load' mhmi_cache how_much mHscMessage mod_graph = do
-- In normal usage plugins are initialised already by ghc/Main.hs this is protective
-- for any client who might interact with GHC via load'.
+ -- See Note [Timing of plugin initialization]
initializeSessionPlugins
modifySession $ \hsc_env -> hsc_env { hsc_mod_graph = mod_graph }
guessOutputFile
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index f709ad801c..f22a4a8655 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -531,6 +531,7 @@ oneShot orig_hsc_env stop_phase srcs = do
-- In oneshot mode, initialise plugins specified on command line
-- we also initialise in ghc/Main but this might be used as an entry point by API clients who
-- should initialise their own plugins but may not.
+ -- See Note [Timing of plugin initialization]
hsc_env <- initializePlugins orig_hsc_env
o_files <- mapMaybeM (compileFile hsc_env stop_phase) srcs
case stop_phase of