diff options
author | Michael Walker <mike@barrucadu.co.uk> | 2016-02-20 09:15:46 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-02-20 09:15:46 +0100 |
commit | ed0d72d892b2e70099aaac758343e1e733478c1e (patch) | |
tree | 4745a60f25fafce047c625664edc13f51b970b99 /compiler/coreSyn | |
parent | a8653c84a6322d10c646b05ea5406a23a4b7ffbb (diff) | |
download | haskell-wip/D1934.tar.gz |
Print which warning-flag controls an emitted warning.wip/D1934
Summary:
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.
Fixes T10752.
Reviewers: austin, hvr, goldfire, bgamari
Subscribers: goldfire, thomie
Differential Revision: https://phabricator.haskell.org/D1934
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r-- | compiler/coreSyn/CoreLint.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index 6dbcbe4ce9..c046e74089 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 Nothing 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 Nothing 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 Nothing Err.SevDump + noSrcSpan defaultDumpStyle (vcat [ lint_banner "errors" (text what) , err , text "*** Offending Program ***" |