summaryrefslogtreecommitdiff
path: root/compiler/typecheck
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-05 18:25:55 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-11 20:33:37 -0400
commitbc41e47123b205a45385a3aa69de97ce22686423 (patch)
treec36b02eb7ec07c9a8ca661c4fae13d81fb3f2d46 /compiler/typecheck
parent8e6febcee4b91a88a5027baac4bee5a8847fe79b (diff)
downloadhaskell-bc41e47123b205a45385a3aa69de97ce22686423.tar.gz
Refactor interpreterDynamic and interpreterProfiled
* `interpreterDynamic` and `interpreterProfiled` now take `Interp` parameters instead of DynFlags * slight refactoring of `ExternalInterp` so that we can read the iserv configuration (which is pure) without reading an MVar.
Diffstat (limited to 'compiler/typecheck')
-rw-r--r--compiler/typecheck/TcSplice.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs
index a4ea37db72..97aff216f7 100644
--- a/compiler/typecheck/TcSplice.hs
+++ b/compiler/typecheck/TcSplice.hs
@@ -776,9 +776,9 @@ convertAnnotationWrapper :: ForeignHValue -> TcM (Either MsgDoc Serialized)
convertAnnotationWrapper fhv = do
interp <- tcGetInterp
case interp of
- ExternalInterp _ -> Right <$> runTH THAnnWrapper fhv
+ ExternalInterp {} -> Right <$> runTH THAnnWrapper fhv
#if defined(HAVE_INTERNAL_INTERPRETER)
- InternalInterp -> do
+ InternalInterp -> do
annotation_wrapper <- liftIO $ wormhole InternalInterp fhv
return $ Right $
case unsafeCoerce annotation_wrapper of
@@ -821,7 +821,7 @@ runRemoteModFinalizers (ThModFinalizers finRefs) = do
runQuasi $ sequence_ qs
#endif
- ExternalInterp iserv -> withIServ_ iserv $ \i -> do
+ ExternalInterp conf iserv -> withIServ_ conf iserv $ \i -> do
tcg <- getGblEnv
th_state <- readTcRef (tcg_th_remote_state tcg)
case th_state of
@@ -1215,11 +1215,11 @@ finishTH :: TcM ()
finishTH = do
hsc_env <- getTopEnv
case hsc_interp hsc_env of
- Nothing -> pure ()
+ Nothing -> pure ()
#if defined(HAVE_INTERNAL_INTERPRETER)
- Just InternalInterp -> pure ()
+ Just InternalInterp -> pure ()
#endif
- Just (ExternalInterp _) -> do
+ Just (ExternalInterp {}) -> do
tcg <- getGblEnv
writeTcRef (tcg_th_remote_state tcg) Nothing
@@ -1248,11 +1248,11 @@ runTH ty fhv = do
return r
#endif
- ExternalInterp iserv ->
+ ExternalInterp conf iserv ->
-- Run it on the server. For an overview of how TH works with
-- Remote GHCi, see Note [Remote Template Haskell] in
-- libraries/ghci/GHCi/TH.hs.
- withIServ_ iserv $ \i -> do
+ withIServ_ conf iserv $ \i -> do
rstate <- getTHState i
loc <- TH.qLocation
liftIO $