summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Module.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-06-22 12:29:47 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-01 03:30:36 -0400
commit6d712150f8f9400397368b45a152a694ba9d5af4 (patch)
tree40a873281b87cc2d677f416ef0b7e87da465ebf7 /compiler/GHC/Tc/Module.hs
parent6f097a8161dfc97be007b83fccbdb71350d786b1 (diff)
downloadhaskell-6d712150f8f9400397368b45a152a694ba9d5af4.tar.gz
Dynflags: introduce DiagOpts
Use DiagOpts for diagnostic options instead of directly querying DynFlags (#17957). Surprising performance improvements on CI: T4801(normal) ghc/alloc 313236344.0 306515216.0 -2.1% GOOD T9961(normal) ghc/alloc 384502736.0 380584384.0 -1.0% GOOD ManyAlternatives(normal) ghc/alloc 797356128.0 786644928.0 -1.3% ManyConstructors(normal) ghc/alloc 4389732432.0 4317740880.0 -1.6% T783(normal) ghc/alloc 408142680.0 402812176.0 -1.3% Metric Decrease: T4801 T9961 T783 ManyAlternatives ManyConstructors Bump haddock submodule
Diffstat (limited to 'compiler/GHC/Tc/Module.hs')
-rw-r--r--compiler/GHC/Tc/Module.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index 08005f1a74..696e8dc8a3 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -53,6 +53,7 @@ import GHC.Prelude
import GHC.Driver.Env
import GHC.Driver.Plugins
import GHC.Driver.Session
+import GHC.Driver.Config.Diagnostic
import GHC.Tc.Errors.Hole.FitTypes ( HoleFitPluginR (..) )
import GHC.Tc.Errors.Types
@@ -3163,6 +3164,7 @@ mark_plugin_unsafe :: DynFlags -> TcM ()
mark_plugin_unsafe dflags = unless (gopt Opt_PluginTrustworthy dflags) $
recordUnsafeInfer pluginUnsafe
where
+ !diag_opts = initDiagOpts dflags
pluginUnsafe =
singleMessage $
- mkPlainMsgEnvelope dflags noSrcSpan TcRnUnsafeDueToPlugin
+ mkPlainMsgEnvelope diag_opts noSrcSpan TcRnUnsafeDueToPlugin