diff options
-rw-r--r-- | hadrian/doc/flavours.md | 5 | ||||
-rw-r--r-- | hadrian/src/Flavour.hs | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index 5f406364a8..ad80962dbf 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -276,6 +276,11 @@ The supported transformers are listed below: <td>Collects timings while building the stage2+ compiler by adding the flags <code>-ddump-to-file -ddump-timings</code>.</td> </tr> + <tr> + <td><code>lint</code></td> + <td>Enable Core, STG, and C-- linting in all compilation with the stage1 + compiler.</td> + </tr> </table> ### Static diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index 41d2f66f19..9344563ba5 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -52,6 +52,7 @@ flavourTransformers = M.fromList , "assertions" =: enableAssertions , "debug_ghc" =: debugGhc Stage1 , "debug_stage1_ghc" =: debugGhc Stage0 + , "lint" =: enableLinting ] where (=:) = (,) @@ -130,6 +131,19 @@ enableTickyGhc = , arg "-ddump-stg-final" ] +-- | Enable Core, STG, and (not C--) linting in all compilations with the stage1 compiler. +enableLinting :: Flavour -> Flavour +enableLinting = + addArgs $ stage1 ? mconcat + [ builder (Ghc CompileHs) ? lint + ] + where + lint = mconcat + [ arg "-dcore-lint" + , arg "-dstg-lint" + -- Should be -dlint but currently -dcmm-lint fails due to #21563 + ] + -- | Transform the input 'Flavour' so as to build with -- @-split-sections@ whenever appropriate. You can -- select which package gets built with split sections |