Skip to content
Snippets Groups Projects
Commit 3db2ab30 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

hadrian: Add enableTickyGhc helper

This took a bit of trial-and-error to get working so it seems worth
having in the tree.
parent a4631335
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ module Flavour ...@@ -4,7 +4,7 @@ module Flavour
-- * Flavour transformers -- * Flavour transformers
, addArgs , addArgs
, splitSections, splitSectionsIf , splitSections, splitSectionsIf
, enableDebugInfo , enableDebugInfo, enableTickyGhc
) where ) where
import Expression import Expression
...@@ -80,6 +80,17 @@ enableDebugInfo = addArgs $ mconcat ...@@ -80,6 +80,17 @@ enableDebugInfo = addArgs $ mconcat
, builder (Cc CompileC) ? notStage0 ? arg "-g3" , 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 -- | Transform the input 'Flavour' so as to build with
-- @-split-sections@ whenever appropriate. You can -- @-split-sections@ whenever appropriate. You can
-- select which package gets built with split sections -- select which package gets built with split sections
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment