[commit: haddock] v2.14: Drop needless --split-objs which slows us down. (76600a6)

git at git.haskell.org git at git.haskell.org
Tue Apr 1 18:08:32 UTC 2014


Repository : ssh://git@git.haskell.org/haddock

On branch  : v2.14
Link       : http://git.haskell.org/haddock.git/commitdiff/76600a683004b61b9871b92b078abf7cf8de1657

>---------------------------------------------------------------

commit 76600a683004b61b9871b92b078abf7cf8de1657
Author: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk>
Date:   Sat Mar 22 16:36:16 2014 +0000

    Drop needless --split-objs which slows us down.
    
    Involves tiny cleanup of all the dynflag bindings. Fixes #292.


>---------------------------------------------------------------

76600a683004b61b9871b92b078abf7cf8de1657
 src/Haddock.hs |   30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/Haddock.hs b/src/Haddock.hs
index e4c7fdc..a7bf45d 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -314,22 +314,20 @@ readInterfaceFiles name_cache_accessor pairs = do
 -- | Start a GHC session with the -haddock flag set. Also turn off
 -- compilation and linking. Then run the given 'Ghc' action.
 withGhc :: String -> [String] -> (DynFlags -> Ghc a) -> IO a
-withGhc libDir flags ghcActs = do
-  runGhc (Just libDir) $ do
-    dynflags  <- getSessionDynFlags
-    let dynflags' = gopt_set dynflags Opt_Haddock
-    let dynflags'' = dynflags' {
-        hscTarget = HscNothing,
-        ghcMode   = CompManager,
-        ghcLink   = NoLink
-      }
-    dynflags''' <- parseGhcFlags dynflags''
-    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'''
+withGhc libDir flags ghcActs = runGhc (Just libDir) $ do
+  dynflags  <- getSessionDynFlags
+  dynflags' <- parseGhcFlags (gopt_set dynflags Opt_Haddock) {
+    hscTarget = HscNothing,
+    ghcMode   = CompManager,
+    ghcLink   = NoLink
+    }
+  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''
   where
     parseGhcFlags :: MonadIO m => DynFlags -> m DynFlags
     parseGhcFlags dynflags = do



More information about the ghc-commits mailing list