From b2577081528fe36facf5153bed256fe838a74ae6 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 29 Jul 2019 19:34:57 -0400 Subject: 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 --- ghc/GHCi/UI.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ghc') 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 -- cgit v1.2.1