summaryrefslogtreecommitdiff
path: root/compiler/coreSyn/CoreLint.hs
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2016-02-25 17:34:07 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-25 17:44:33 +0100
commit736c2fe705f083fe42bd5fe9318f0636b6b2fca6 (patch)
treed55e5e571c21850cbabec1c9f8387d56033b0edc /compiler/coreSyn/CoreLint.hs
parente38c07bf5ceb8f50fa5110b70b3b83f0ce1358ba (diff)
downloadhaskell-wip/warning-origins.tar.gz
Print which warning-flag controls an emitted warning.wip/warning-origins
Both gcc and clang tell which warning flag a reported warning can be controlled with, this patch makes ghc do the same. More generally, this allows for annotated compiler output, where an optional annotation is displayed in brackets after the severity. Display which group enables a warning. Add flag to show which group a warning belongs to ``-f(no-)show-warning-groups``, used to show/hide the group an emitted warning belongs to. On by default. Fix compilation error in ghc-api test Reviewers: goldfire, hvr, quchen, austin, bgamari Reviewed By: quchen, bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1943 GHC Trac Issues: #10752
Diffstat (limited to 'compiler/coreSyn/CoreLint.hs')
-rw-r--r--compiler/coreSyn/CoreLint.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index f9cb4be3b3..f5d0f84054 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -284,7 +284,7 @@ displayLintResults :: DynFlags -> CoreToDo
-> IO ()
displayLintResults dflags pass warns errs binds
| not (isEmptyBag errs)
- = do { log_action dflags dflags Err.SevDump noSrcSpan defaultDumpStyle
+ = do { log_action dflags dflags NoReason Err.SevDump noSrcSpan defaultDumpStyle
(vcat [ lint_banner "errors" (ppr pass), Err.pprMessageBag errs
, text "*** Offending Program ***"
, pprCoreBindings binds
@@ -294,7 +294,7 @@ displayLintResults dflags pass warns errs binds
| not (isEmptyBag warns)
, not opt_NoDebugOutput
, showLintWarnings pass
- = log_action dflags dflags Err.SevDump noSrcSpan defaultDumpStyle
+ = log_action dflags dflags NoReason Err.SevDump noSrcSpan defaultDumpStyle
(lint_banner "warnings" (ppr pass) $$ Err.pprMessageBag warns)
| otherwise = return ()
@@ -324,7 +324,8 @@ lintInteractiveExpr what hsc_env expr
dflags = hsc_dflags hsc_env
display_lint_err err
- = do { log_action dflags dflags Err.SevDump noSrcSpan defaultDumpStyle
+ = do { log_action dflags dflags NoReason Err.SevDump
+ noSrcSpan defaultDumpStyle
(vcat [ lint_banner "errors" (text what)
, err
, text "*** Offending Program ***"