diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-11-07 12:53:59 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-08 05:38:11 -0500 |
commit | 3db2ab306d56582ac4d7600755393bf2e52a86cf (patch) | |
tree | 1068ffd2bdc6ab6feee7d299191999da41db0d1b /hadrian | |
parent | a46313352280d6c28ee505e0f63ade11077ef7c6 (diff) | |
download | haskell-3db2ab306d56582ac4d7600755393bf2e52a86cf.tar.gz |
hadrian: Add enableTickyGhc helper
This took a bit of trial-and-error to get working so it seems worth
having in the tree.
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Flavour.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index dba8621952..dd203ea88e 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -4,7 +4,7 @@ module Flavour -- * Flavour transformers , addArgs , splitSections, splitSectionsIf - , enableDebugInfo + , enableDebugInfo, enableTickyGhc ) where import Expression @@ -80,6 +80,17 @@ enableDebugInfo = addArgs $ mconcat , builder (Cc CompileC) ? notStage0 ? arg "-g3" ] +-- | Enable the ticky-ticky profiler in stage2 GHC +enableTickyGhc :: Flavour -> Flavour +enableTickyGhc = + addArgs $ foldMap enableTickyFor [ghc, compiler, base] + where + enableTickyFor pkg = stage1 ? package pkg ? mconcat + [ builder (Ghc CompileHs) ? ticky + , builder (Ghc LinkHs) ? ticky + ] + ticky = arg "-ticky" <> arg "-ticky-allocd" + -- | Transform the input 'Flavour' so as to build with -- @-split-sections@ whenever appropriate. You can -- select which package gets built with split sections |