summaryrefslogtreecommitdiff
path: root/compiler/GHC/SysTools
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-03-21 14:57:43 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-17 20:22:02 -0400
commitef3c8d9e077a1d4ede0724075489fb1f12afa3f9 (patch)
tree9bd61626c036af10e0866aa6a5541d33cac60e4c /compiler/GHC/SysTools
parent0e2d16eb76037152c96226f0f65a5ebdee64f7b6 (diff)
downloadhaskell-ef3c8d9e077a1d4ede0724075489fb1f12afa3f9.tar.gz
Don't store LlvmConfig into DynFlags
LlvmConfig contains information read from llvm-passes and llvm-targets files in GHC's top directory. Reading these files is done only when needed (i.e. when the LLVM backend is used) and cached for the whole compiler session. This patch changes the way this is done: - Split LlvmConfig into LlvmConfig and LlvmConfigCache - Store LlvmConfigCache in HscEnv instead of DynFlags: there is no good reason to store it in DynFlags. As it is fixed per session, we store it in the session state instead (HscEnv). - Initializing LlvmConfigCache required some changes to driver functions such as newHscEnv. I've used the opportunity to untangle initHscEnv from initGhcMonad (in top-level GHC module) and to move it to GHC.Driver.Main, close to newHscEnv. - I've also made `cmmPipeline` independent of HscEnv in order to remove the call to newHscEnv in regalloc_unit_tests.
Diffstat (limited to 'compiler/GHC/SysTools')
-rw-r--r--compiler/GHC/SysTools/Tasks.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs
index ce741e2c1a..312ec7897a 100644
--- a/compiler/GHC/SysTools/Tasks.hs
+++ b/compiler/GHC/SysTools/Tasks.hs
@@ -14,8 +14,7 @@ import GHC.Platform
import GHC.ForeignSrcLang
import GHC.IO (catchException)
-import GHC.CmmToLlvm.Base (llvmVersionStr, supportedLlvmVersionUpperBound, parseLlvmVersion, supportedLlvmVersionLowerBound)
-import GHC.CmmToLlvm.Config (LlvmVersion)
+import GHC.CmmToLlvm.Config (LlvmVersion, llvmVersionStr, supportedLlvmVersionUpperBound, parseLlvmVersion, supportedLlvmVersionLowerBound)
import GHC.SysTools.Process
import GHC.SysTools.Info