[Git][ghc/ghc][master] Enable external interpreter when TH is requested but no internal interpreter is available

Marge Bot gitlab at gitlab.haskell.org
Mon May 6 19:17:47 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
e172a6d1 by Alp Mestanogullari at 2019-05-06T19:11:43Z
Enable external interpreter when TH is requested but no internal interpreter is available

- - - - -


1 changed file:

- compiler/main/DriverPipeline.hs


Changes:

=====================================
compiler/main/DriverPipeline.hs
=====================================
@@ -258,16 +258,23 @@ compileOne' m_tc_result mHscMessage
                   then gopt_set dflags0 Opt_BuildDynamicToo
                   else dflags0
 
+       -- #16331 - when no "internal interpreter" is available but we
+       -- need to process some TemplateHaskell or QuasiQuotes, we automatically
+       -- turn on -fexternal-interpreter.
+       dflags2 = if not internalInterpreter && needsLinker
+                 then gopt_set dflags1 Opt_ExternalInterpreter
+                 else dflags1
+
        basename = dropExtension input_fn
 
        -- We add the directory in which the .hs files resides) to the import
        -- path.  This is needed when we try to compile the .hc file later, if it
        -- imports a _stub.h file that we created here.
        current_dir = takeDirectory basename
-       old_paths   = includePaths dflags1
+       old_paths   = includePaths dflags2
        !prevailing_dflags = hsc_dflags hsc_env0
        dflags =
-          dflags1 { includePaths = addQuoteInclude old_paths [current_dir]
+          dflags2 { includePaths = addQuoteInclude old_paths [current_dir]
                   , log_action = log_action prevailing_dflags }
                   -- use the prevailing log_action / log_finaliser,
                   -- not the one cached in the summary.  This is so



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/e172a6d127a65b945b31306ff7b6c43320debfb4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/e172a6d127a65b945b31306ff7b6c43320debfb4
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190506/ba974bea/attachment.html>


More information about the ghc-commits mailing list