summaryrefslogtreecommitdiff
path: root/ghc
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 /ghc
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 'ghc')
-rw-r--r--ghc/GHCi/UI.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 94fc07660b..ff607d645c 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -3005,7 +3005,7 @@ showDynFlags show_all dflags = do
is_on = test f dflags
quiet = not show_all && test f default_dflags == is_on
- default_dflags = defaultDynFlags (settings dflags) (llvmConfig dflags)
+ default_dflags = defaultDynFlags (settings dflags)
(ghciFlags,others) = partition (\f -> flagSpecFlag f `elem` flgs)
DynFlags.fFlags
@@ -3458,8 +3458,7 @@ showLanguages' show_all dflags =
is_on = test f dflags
quiet = not show_all && test f default_dflags == is_on
- default_dflags =
- defaultDynFlags (settings dflags) (llvmConfig dflags) `lang_set` Just lang
+ default_dflags = defaultDynFlags (settings dflags) `lang_set` Just lang
lang = fromMaybe GHC2021 (language dflags)