summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-07-29 19:34:57 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-07 12:01:46 -0400
commitb2577081528fe36facf5153bed256fe838a74ae6 (patch)
treec0ce42d462656bc3dae6543c5239a8e56a5e2217 /ghc
parent825c108bd26f20accf1eaef2ba652a2ee12924bb (diff)
downloadhaskell-b2577081528fe36facf5153bed256fe838a74ae6.tar.gz
Refactor, document, and optimize LLVM configuration loading
As described in the new Note [LLVM Configuration] in SysTools, we now load llvm-targets and llvm-passes lazily to avoid the overhead of doing so when -fllvm isn't used (also known as "the common case"). Noticed in #17003. Metric Decrease: T12234 T12150
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index e70992f667..4432244dca 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -2775,9 +2775,7 @@ showDynFlags show_all dflags = do
is_on = test f dflags
quiet = not show_all && test f default_dflags == is_on
- llvmConfig = (llvmTargets dflags, llvmPasses dflags)
-
- default_dflags = defaultDynFlags (settings dflags) llvmConfig
+ default_dflags = defaultDynFlags (settings dflags) (llvmConfig dflags)
(ghciFlags,others) = partition (\f -> flagSpecFlag f `elem` flgs)
DynFlags.fFlags
@@ -3229,10 +3227,8 @@ showLanguages' show_all dflags =
is_on = test f dflags
quiet = not show_all && test f default_dflags == is_on
- llvmConfig = (llvmTargets dflags, llvmPasses dflags)
-
default_dflags =
- defaultDynFlags (settings dflags) llvmConfig `lang_set`
+ defaultDynFlags (settings dflags) (llvmConfig dflags) `lang_set`
case language dflags of
Nothing -> Just Haskell2010
other -> other