diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-07-29 19:34:57 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-07 12:01:46 -0400 |
commit | b2577081528fe36facf5153bed256fe838a74ae6 (patch) | |
tree | c0ce42d462656bc3dae6543c5239a8e56a5e2217 /ghc | |
parent | 825c108bd26f20accf1eaef2ba652a2ee12924bb (diff) | |
download | haskell-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.hs | 8 |
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 |