diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-10-03 16:08:02 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-10-11 11:16:06 +0200 |
commit | b4e96b2d129096882a46976f705de5af131778a7 (patch) | |
tree | f6b413fb52c343ec46c371266af5b15875d26f90 | |
parent | ed4b5885bdac7b986655bb40f8c9ece2f8735c98 (diff) | |
download | haskell-wip/T22218.tar.gz |
Make Cmm Lint messages use dump stylewip/T22218
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)]) |