[commit: packages/Cabal] ghc-head: Make the code a bit more readable. (6d22b98)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:28:26 CEST 2013


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

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=6d22b989c0e12839e8b26f3db8e9e9b809874148

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

commit 6d22b989c0e12839e8b26f3db8e9e9b809874148
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Fri Jul 12 03:48:15 2013 +0200

    Make the code a bit more readable.


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

6d22b989c0e12839e8b26f3db8e9e9b809874148
 Cabal/Distribution/Simple/GHC.hs |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs
index a4335b9..d0527c0 100644
--- a/Cabal/Distribution/Simple/GHC.hs
+++ b/Cabal/Distribution/Simple/GHC.hs
@@ -710,15 +710,14 @@ buildLib verbosity pkg_descr lbi lib clbi = do
                                              "-dynosuf", "dyn_o"]
                           }
 
-  -- TODO: the logic in this fragment is quite convoluted. Should be possible to
-  -- simplify/refactor.
   unless (null (libModules lib)) $
     do let vanilla = whenVanillaLib forceVanillaLib (runGhcProg vanillaOpts)
            shared  = whenSharedLib  forceSharedLib  (runGhcProg sharedOpts)
-       if dynamicTooSupported &&
-          (forceVanillaLib || withVanillaLib lbi) &&
-          (forceSharedLib  || withSharedLib  lbi)  &&
-          null (ghcSharedOptions libBi)
+           useDynToo = dynamicTooSupported &&
+                       (forceVanillaLib || withVanillaLib lbi) &&
+                       (forceSharedLib  || withSharedLib  lbi) &&
+                       null (ghcSharedOptions libBi)
+       if useDynToo
            then runGhcProg vanillaSharedOpts
            else if isGhcDynamic then do shared;  vanilla
                                 else do vanilla; shared





More information about the ghc-commits mailing list