[commit: ghc] wip/nfs-locking: Add --integer-simple command line argument (b42cac6)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:48:35 UTC 2017


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

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/b42cac65d1a65a101179613dba66d3b711948b84/ghc

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

commit b42cac65d1a65a101179613dba66d3b711948b84
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Thu Jan 12 23:31:50 2017 +0000

    Add --integer-simple command line argument
    
    See #179


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

b42cac65d1a65a101179613dba66d3b711948b84
 src/CmdLineFlag.hs      | 16 +++++++++++++---
 src/Settings/Default.hs |  2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/CmdLineFlag.hs b/src/CmdLineFlag.hs
index ebe907a..961a033 100644
--- a/src/CmdLineFlag.hs
+++ b/src/CmdLineFlag.hs
@@ -1,7 +1,7 @@
 module CmdLineFlag (
-    putCmdLineFlags, cmdFlags, cmdBuildHaddock, cmdFlavour, cmdProgressColour,
-    ProgressColour (..), cmdProgressInfo, ProgressInfo (..), cmdSkipConfigure,
-    cmdSplitObjects
+    putCmdLineFlags, cmdFlags, cmdBuildHaddock, cmdFlavour, cmdIntegerSimple,
+    cmdProgressColour, ProgressColour (..), cmdProgressInfo, ProgressInfo (..),
+    cmdSkipConfigure, cmdSplitObjects
     ) where
 
 import Data.IORef
@@ -15,6 +15,7 @@ import System.IO.Unsafe
 data Untracked = Untracked
     { buildHaddock   :: Bool
     , flavour        :: Maybe String
+    , integerSimple  :: Bool
     , progressColour :: ProgressColour
     , progressInfo   :: ProgressInfo
     , skipConfigure  :: Bool
@@ -29,6 +30,7 @@ defaultUntracked :: Untracked
 defaultUntracked = Untracked
     { buildHaddock   = False
     , flavour        = Nothing
+    , integerSimple  = False
     , progressColour = Auto
     , progressInfo   = Normal
     , skipConfigure  = False
@@ -40,6 +42,9 @@ readBuildHaddock = Right $ \flags -> flags { buildHaddock = True }
 readFlavour :: Maybe String -> Either String (Untracked -> Untracked)
 readFlavour ms = Right $ \flags -> flags { flavour = lower <$> ms }
 
+readIntegerSimple :: Either String (Untracked -> Untracked)
+readIntegerSimple = Right $ \flags -> flags { integerSimple = True }
+
 readProgressColour :: Maybe String -> Either String (Untracked -> Untracked)
 readProgressColour ms =
     maybe (Left "Cannot parse progress-colour") (Right . set) (go =<< lower <$> ms)
@@ -77,6 +82,8 @@ cmdFlags =
       "Build flavour (Default, Devel1, Devel2, Perf, Prof, Quick or Quickest)."
     , Option [] ["haddock"] (NoArg readBuildHaddock)
       "Generate Haddock documentation."
+    , Option [] ["integer-simple"] (NoArg readIntegerSimple)
+      "Build GHC with integer-simple library."
     , Option [] ["progress-colour"] (OptArg readProgressColour "MODE")
       "Use colours in progress info (Never, Auto or Always)."
     , Option [] ["progress-info"] (OptArg readProgressInfo "STYLE")
@@ -105,6 +112,9 @@ cmdBuildHaddock = buildHaddock getCmdLineFlags
 cmdFlavour :: Maybe String
 cmdFlavour = flavour getCmdLineFlags
 
+cmdIntegerSimple :: Bool
+cmdIntegerSimple = integerSimple getCmdLineFlags
+
 cmdProgressColour :: ProgressColour
 cmdProgressColour = progressColour getCmdLineFlags
 
diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs
index 18f0ae0..351d780 100644
--- a/src/Settings/Default.hs
+++ b/src/Settings/Default.hs
@@ -177,7 +177,7 @@ defaultFlavour = Flavour
     { name               = "default"
     , args               = defaultArgs
     , packages           = defaultPackages
-    , integerLibrary     = integerGmp
+    , integerLibrary     = if cmdIntegerSimple then integerSimple else integerGmp
     , libraryWays        = defaultLibraryWays
     , rtsWays            = defaultRtsWays
     , splitObjects       = defaultSplitObjects



More information about the ghc-commits mailing list