[commit: ghc] wip/nfs-locking: Add prof flavour (bc44c00)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:15:32 UTC 2017


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

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

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

commit bc44c00792276d7834258db442af9fe687d22a01
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Fri Jan 6 02:00:02 2017 +0000

    Add prof flavour


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

bc44c00792276d7834258db442af9fe687d22a01
 hadrian.cabal                 |  1 +
 src/Settings.hs               |  4 +++-
 src/Settings/Flavours/Prof.hs | 21 +++++++++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/hadrian.cabal b/hadrian.cabal
index 4f3c2f6..712d4c6 100644
--- a/hadrian.cabal
+++ b/hadrian.cabal
@@ -86,6 +86,7 @@ executable hadrian
                        , Settings.Builders.Tar
                        , Settings.Default
                        , Settings.Flavours.Perf
+                       , Settings.Flavours.Prof
                        , Settings.Flavours.Quick
                        , Settings.Flavours.Quickest
                        , Settings.Packages.Base
diff --git a/src/Settings.hs b/src/Settings.hs
index 18dd15b..8f94e5b 100644
--- a/src/Settings.hs
+++ b/src/Settings.hs
@@ -15,6 +15,7 @@ import Oracles.PackageData
 import Oracles.Path
 import {-# SOURCE #-} Settings.Default
 import Settings.Flavours.Perf
+import Settings.Flavours.Prof
 import Settings.Flavours.Quick
 import Settings.Flavours.Quickest
 import Settings.Path
@@ -51,7 +52,8 @@ getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
 getPkgDataList key = lift . pkgDataList . key =<< getBuildPath
 
 hadrianFlavours :: [Flavour]
-hadrianFlavours = [defaultFlavour, perfFlavour, quickFlavour, quickestFlavour]
+hadrianFlavours = [ defaultFlavour, perfFlavour, profFlavour, quickFlavour
+                  , quickestFlavour ]
 
 flavour :: Flavour
 flavour = fromMaybe unknownFlavour $ find ((== flavourName) . name) flavours
diff --git a/src/Settings/Flavours/Prof.hs b/src/Settings/Flavours/Prof.hs
new file mode 100644
index 0000000..4dee8fc
--- /dev/null
+++ b/src/Settings/Flavours/Prof.hs
@@ -0,0 +1,21 @@
+module Settings.Flavours.Prof (profFlavour) where
+
+import Context
+import Flavour
+import GHC
+import Predicate
+import {-# SOURCE #-} Settings.Default
+
+profFlavour :: Flavour
+profFlavour = defaultFlavour
+    { name        = "prof"
+    , args        = defaultArgs <> profArgs
+    , ghcProfiled = True }
+
+optimise :: Context -> Bool
+optimise Context {..} = package `elem` [compiler, ghc] || isLibrary package
+
+profArgs :: Args
+profArgs = builder Ghc ? do
+    context <- getContext
+    if optimise context then arg "-O" else arg "-O0"



More information about the ghc-commits mailing list