Commit 1fe806d3 authored by Cheng Shao's avatar Cheng Shao Committed by Marge Bot
Browse files

hadrian: add hi_core flavour transformer

The hi_core flavour transformer enables -fwrite-if-simplified-core for
stage1 libraries, which emit core into interface files to make it
possible to restart code generation. Building boot libs with it makes
it easier to use GHC API to prototype experimental backends that needs
core/stg at link time.
parent 14b5982a
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment