summaryrefslogtreecommitdiff
path: root/hadrian/src/Flavour.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hadrian/src/Flavour.hs')
-rw-r--r--hadrian/src/Flavour.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index 9f8bd1d955..39ef49f11a 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -15,6 +15,7 @@ module Flavour
, disableProfiledLibs
, enableLinting
, enableHaddock
+ , enableHiCore
, useNativeBignum
, omitPragmas
@@ -62,6 +63,7 @@ flavourTransformers = M.fromList
, "debug_stage1_ghc" =: debugGhc stage0InTree
, "lint" =: enableLinting
, "haddock" =: enableHaddock
+ , "hi_core" =: enableHiCore
, "late_ccs" =: enableLateCCS
]
where (=:) = (,)
@@ -180,6 +182,13 @@ enableHaddock =
[ arg "-haddock"
]
+-- | Build stage2 dependencies with options to emit Core into
+-- interface files which is sufficient to restart code generation.
+enableHiCore :: Flavour -> Flavour
+enableHiCore = addArgs
+ $ notStage0 ? builder (Ghc CompileHs)
+ ? pure ["-fwrite-if-simplified-core"]
+
-- | Transform the input 'Flavour' so as to build with
-- @-split-sections@ whenever appropriate.
-- Note that this transformer doesn't do anything