[Git][ghc/ghc][master] Add flavour transformer assertions_stage1
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: da40e553 by Simon Peyton Jones at 2026-01-07T10:30:00-05:00 Add flavour transformer assertions_stage1 This allows us to enable -DDEBUG assertions in the stage1 compiler - - - - - 2 changed files: - hadrian/doc/flavours.md - hadrian/src/Flavour.hs Changes: ===================================== hadrian/doc/flavours.md ===================================== @@ -297,7 +297,11 @@ The supported transformers are listed below: </tr> <tr> <td><code>assertions</code></td> - <td>Build the stage2 compiler with assertions enabled. </td> + <td>Build the stage2 compiler with <code>-DDEBUG</code> assertions enabled. </td> + </tr> + <tr> + <td><code>assertions_stage1</code></td> + <td>Build the stage1 compiler with <code>-DDEBUG</code> assertions enabled. </td> </tr> <tr> <td><code>fully_static</code></td> ===================================== hadrian/src/Flavour.hs ===================================== @@ -70,7 +70,8 @@ flavourTransformers = M.fromList , "fully_static" =: fullyStatic , "host_fully_static" =: hostFullyStatic , "collect_timings" =: collectTimings - , "assertions" =: enableAssertions + , "assertions" =: enableAssertions Stage2 + , "assertions_stage1" =: enableAssertions Stage1 , "debug_ghc" =: debugGhc Stage2 , "debug_stage1_ghc" =: debugGhc Stage1 , "lint" =: enableLinting @@ -393,12 +394,12 @@ enableLateCCS = addArgs ? ((Profiling `wayUnit`) <$> getWay) ? arg "-fprof-late" --- | Enable assertions for the stage2 compiler -enableAssertions :: Flavour -> Flavour -enableAssertions flav = flav { ghcDebugAssertions = f } +-- | Enable -DDEBUG assertions in the compiler, at a specified stage +enableAssertions :: Stage -> Flavour -> Flavour +enableAssertions stage flav = flav { ghcDebugAssertions = f } where - f Stage2 = True - f st = ghcDebugAssertions flav st + f s | s == stage = True + | otherwise = ghcDebugAssertions flav s -- | Build the stage3 compiler using the non-moving GC. enableBootNonmovingGc :: Flavour -> Flavour View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da40e55359732f175a6502e326952401... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da40e55359732f175a6502e326952401... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)