diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-10-03 16:08:02 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-10-11 23:45:46 -0400 |
commit | 27978ceb649e929df29a94e98916c341169395af (patch) | |
tree | c6d1c6fd7c48c689ef6c0fcc5b7e4642318a45d0 | |
parent | 9b572d541d1d356d7836408ffa98a7b300d02174 (diff) | |
download | haskell-27978ceb649e929df29a94e98916c341169395af.tar.gz |
Make Cmm Lint messages use dump style
Lint errors indicate an internal error in GHC, so it makes sense to use
it instead of the user style. This is consistent with Core Lint and STG Lint:
https://gitlab.haskell.org/ghc/ghc/-/blob/22096652/compiler/GHC/Core/Lint.hs#L429
https://gitlab.haskell.org/ghc/ghc/-/blob/22096652/compiler/GHC/Stg/Lint.hs#L144
Fixes #22218.
-rw-r--r-- | compiler/GHC/Cmm/Lint.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Cmm/Lint.hs b/compiler/GHC/Cmm/Lint.hs index 8b4b1cefb0..af27e5932a 100644 --- a/compiler/GHC/Cmm/Lint.hs +++ b/compiler/GHC/Cmm/Lint.hs @@ -50,7 +50,8 @@ cmmLintGraph platform g = runCmmLint platform lintCmmGraph g runCmmLint :: OutputableP Platform a => Platform -> (a -> CmmLint b) -> a -> Maybe SDoc runCmmLint platform l p = case unCL (l p) platform of - Left err -> Just (vcat [text "Cmm lint error:", + Left err -> Just (withPprStyle defaultDumpStyle $ vcat + [text "Cmm lint error:", nest 2 err, text "Program was:", nest 2 (pdoc platform p)]) |