[commit: ghc] master: DynFlags: call defaultWays when creating defaultFlags (29ca4a1)

git at git.haskell.org git at git.haskell.org
Mon Dec 21 01:24:04 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/29ca4a19a4aa2753817428ff893555e8e3a852af/ghc

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

commit 29ca4a19a4aa2753817428ff893555e8e3a852af
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Sun Dec 13 11:42:42 2015 +0100

    DynFlags: call defaultWays when creating defaultFlags
    
    Instead of duplicating its logic. Refactoring only.
    
    For reference, `defaultWays` looks like this:
    
      defaultWays :: Settings -> [Way]
      defaultWays settings = if pc_DYNAMIC_BY_DEFAULT (sPlatformConstants settings)
                            then [WayDyn]
                            else []
    
    Reviewed by: bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1675


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

29ca4a19a4aa2753817428ff893555e8e3a852af
 compiler/main/DynFlags.hs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 84dc188..a23ecfa 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3211,9 +3211,7 @@ defaultFlags settings
 
     ++ default_PIC platform
 
-    ++ (if pc_DYNAMIC_BY_DEFAULT (sPlatformConstants settings)
-        then wayGeneralFlags platform WayDyn
-        else [])
+    ++ concatMap (wayGeneralFlags platform) (defaultWays settings)
 
     where platform = sTargetPlatform settings
 



More information about the ghc-commits mailing list