Rework plugin initialisation points
In general this patch pushes plugin initialisation points to earlier in
the pipeline. As plugins can modify the `HscEnv`, it's imperative that
the plugins are initialised as soon as possible and used thereafter.
For example, there are some new tests which modify hsc_logger and other
hooks which failed to fire before (and now do)
One consequence of this change is that the error for specifying the
usage of a HPT plugin from the command line has changed, because it's
now attempted to be loaded at initialisation rather than causing a
cyclic module import.
Closes #21279
Co-authored-by:
Matthew Pickering <matthewtpickering@gmail.com>
Showing
- compiler/GHC/Driver/Make.hs 6 additions, 5 deletionscompiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs 6 additions, 1 deletioncompiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs 8 additions, 7 deletionscompiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Runtime/Loader.hs 5 additions, 1 deletioncompiler/GHC/Runtime/Loader.hs
- ghc/Main.hs 10 additions, 3 deletionsghc/Main.hs
- testsuite/tests/plugins/all.T 14 additions, 0 deletionstestsuite/tests/plugins/all.T
- testsuite/tests/plugins/hooks-plugin/Hooks/LogPlugin.hs 24 additions, 0 deletionstestsuite/tests/plugins/hooks-plugin/Hooks/LogPlugin.hs
- testsuite/tests/plugins/hooks-plugin/Hooks/MetaPlugin.hs 1 addition, 1 deletiontestsuite/tests/plugins/hooks-plugin/Hooks/MetaPlugin.hs
- testsuite/tests/plugins/hooks-plugin/Hooks/PhasePlugin.hs 30 additions, 0 deletionstestsuite/tests/plugins/hooks-plugin/Hooks/PhasePlugin.hs
- testsuite/tests/plugins/hooks-plugin/hooks-plugin.cabal 1 addition, 1 deletiontestsuite/tests/plugins/hooks-plugin/hooks-plugin.cabal
- testsuite/tests/plugins/plugins04.stderr 1 addition, 2 deletionstestsuite/tests/plugins/plugins04.stderr
- testsuite/tests/plugins/test-hooks-plugin.hs 1 addition, 1 deletiontestsuite/tests/plugins/test-hooks-plugin.hs
- testsuite/tests/plugins/test-log-hooks-plugin.hs 4 additions, 0 deletionstestsuite/tests/plugins/test-log-hooks-plugin.hs
- testsuite/tests/plugins/test-log-hooks-plugin.stderr 9 additions, 0 deletionstestsuite/tests/plugins/test-log-hooks-plugin.stderr
- testsuite/tests/plugins/test-phase-hooks-plugin.hs 5 additions, 0 deletionstestsuite/tests/plugins/test-phase-hooks-plugin.hs
- testsuite/tests/plugins/test-phase-hooks-plugin.stderr 5 additions, 0 deletionstestsuite/tests/plugins/test-phase-hooks-plugin.stderr
Loading
Please register or sign in to comment