From 725faca5ee670f80359321adc112408880e9c073 Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Sat, 22 Mar 2014 16:36:16 +0000 Subject: Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes #292. --- src/Haddock.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index 6d975c9b..78844c96 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -317,19 +317,18 @@ readInterfaceFiles name_cache_accessor pairs = do withGhc :: String -> [String] -> (DynFlags -> Ghc a) -> IO a withGhc libDir flags ghcActs = runGhc (Just libDir) $ do dynflags <- getSessionDynFlags - let dynflags' = gopt_set dynflags Opt_Haddock - let dynflags'' = dynflags' { - hscTarget = HscNothing, - ghcMode = CompManager, - ghcLink = NoLink + dynflags' <- parseGhcFlags (gopt_set dynflags Opt_Haddock) { + hscTarget = HscNothing, + ghcMode = CompManager, + ghcLink = NoLink } - dynflags''' <- parseGhcFlags dynflags'' - defaultCleanupHandler dynflags''' $ do + let dynflags'' = gopt_unset dynflags' Opt_SplitObjs + defaultCleanupHandler dynflags'' $ do -- ignore the following return-value, which is a list of packages -- that may need to be re-linked: Haddock doesn't do any -- dynamic or static linking at all! - _ <- setSessionDynFlags dynflags''' - ghcActs dynflags''' + _ <- setSessionDynFlags dynflags'' + ghcActs dynflags'' where parseGhcFlags :: MonadIO m => DynFlags -> m DynFlags parseGhcFlags dynflags = do -- cgit v1.2.3