summaryrefslogtreecommitdiff
path: root/compiler/ghci/Linker.hs
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2016-02-20 09:15:46 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2016-02-20 09:15:46 +0100
commited0d72d892b2e70099aaac758343e1e733478c1e (patch)
tree4745a60f25fafce047c625664edc13f51b970b99 /compiler/ghci/Linker.hs
parenta8653c84a6322d10c646b05ea5406a23a4b7ffbb (diff)
downloadhaskell-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/ghci/Linker.hs')
-rw-r--r--compiler/ghci/Linker.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index 2b471ee0ee..a434d242b7 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -235,7 +235,7 @@ withExtendedLinkEnv new_env action
showLinkerState :: DynFlags -> IO ()
showLinkerState dflags
= do pls <- readIORef v_PersistentLinkerState >>= readMVar
- log_action dflags dflags SevDump noSrcSpan defaultDumpStyle
+ log_action dflags dflags Nothing SevDump noSrcSpan defaultDumpStyle
(vcat [text "----- Linker state -----",
text "Pkgs:" <+> ppr (pkgs_loaded pls),
text "Objs:" <+> ppr (objs_loaded pls),
@@ -374,7 +374,7 @@ classifyLdInput dflags f
| isObjectFilename platform f = return (Just (Object f))
| isDynLibFilename platform f = return (Just (DLLPath f))
| otherwise = do
- log_action dflags dflags SevInfo noSrcSpan defaultUserStyle
+ log_action dflags dflags Nothing SevInfo noSrcSpan defaultUserStyle
(text ("Warning: ignoring unrecognised input `" ++ f ++ "'"))
return Nothing
where platform = targetPlatform dflags
@@ -1397,7 +1397,8 @@ maybePutStr :: DynFlags -> String -> IO ()
maybePutStr dflags s
= when (verbosity dflags > 1) $
do let act = log_action dflags
- act dflags SevInteractive noSrcSpan defaultUserStyle (text s)
+ act dflags Nothing SevInteractive noSrcSpan defaultUserStyle
+ (text s)
maybePutStrLn :: DynFlags -> String -> IO ()
maybePutStrLn dflags s = maybePutStr dflags (s ++ "\n")