summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-12-18 19:31:35 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-06 13:03:16 -0400
commitc657a616d126dbbf1fadb8f195e569ee86061593 (patch)
tree40deb0609beba59a90af4f89d1a9f5b06f2d8abf
parent9b645ee1a9fff64b66b36dc73d8809ff82025829 (diff)
downloadhaskell-c657a616d126dbbf1fadb8f195e569ee86061593.tar.gz
hadrian: Clean up flavour transformer definitions
Previously the `ipe` and `omit_pragmas` transformers were hackily defined using the textual key-value syntax. Fix this.
-rw-r--r--hadrian/src/Flavour.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs
index 288d5ccc3d..41c86de5ff 100644
--- a/hadrian/src/Flavour.hs
+++ b/hadrian/src/Flavour.hs
@@ -192,18 +192,16 @@ disableProfiledLibs flavour =
-- | Build stage2 compiler with -fomit-interface-pragmas to reduce
-- recompilation.
omitPragmas :: Flavour -> Flavour
-omitPragmas =
- let Right kv = parseKV "stage1.ghc.ghc.hs.opts += -fomit-interface-pragmas"
- Right transformer = applySetting kv
- in transformer
+omitPragmas = addArgs
+ $ notStage0 ? builder (Ghc CompileHs) ? package compiler
+ ? arg "-fomit-interface-pragmas"
-- | Build stage2 dependencies with options to enable IPE debugging
-- information.
enableIPE :: Flavour -> Flavour
-enableIPE =
- let Right kv = parseKV "stage1.*.ghc.hs.opts += -finfo-table-map -fdistinct-constructor-tables"
- Right transformer = applySetting kv
- in transformer
+enableIPE = addArgs
+ $ notStage0 ? builder (Ghc CompileHs)
+ ? pure ["-finfo-table-map", "-fdistinct-constructor-tables"]
enableLateCCS :: Flavour -> Flavour
enableLateCCS =