summaryrefslogtreecommitdiff
path: root/compiler/main/GhcMake.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/main/GhcMake.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/main/GhcMake.hs')
-rw-r--r--compiler/main/GhcMake.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 7bbe4be495..3e62d8dea4 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -678,7 +678,7 @@ checkStability hpt sccs all_home_mods = foldl checkSCC ([],[]) sccs
-- | Each module is given a unique 'LogQueue' to redirect compilation messages
-- to. A 'Nothing' value contains the result of compilation, and denotes the
-- end of the message queue.
-data LogQueue = LogQueue !(IORef [Maybe (Severity, SrcSpan, PprStyle, MsgDoc)])
+data LogQueue = LogQueue !(IORef [Maybe (Maybe WarningFlag, Severity, SrcSpan, PprStyle, MsgDoc)])
!(MVar ())
-- | The graph of modules to compile and their corresponding result 'MVar' and
@@ -879,7 +879,7 @@ parUpsweep n_jobs old_hpt stable_mods cleanup sccs = do
return (success_flag,ok_results)
where
- writeLogQueue :: LogQueue -> Maybe (Severity,SrcSpan,PprStyle,MsgDoc) -> IO ()
+ writeLogQueue :: LogQueue -> Maybe (Maybe WarningFlag,Severity,SrcSpan,PprStyle,MsgDoc) -> IO ()
writeLogQueue (LogQueue ref sem) msg = do
atomicModifyIORef' ref $ \msgs -> (msg:msgs,())
_ <- tryPutMVar sem ()
@@ -888,8 +888,8 @@ parUpsweep n_jobs old_hpt stable_mods cleanup sccs = do
-- The log_action callback that is used to synchronize messages from a
-- worker thread.
parLogAction :: LogQueue -> LogAction
- parLogAction log_queue _dflags !severity !srcSpan !style !msg = do
- writeLogQueue log_queue (Just (severity,srcSpan,style,msg))
+ parLogAction log_queue _dflags !flag !severity !srcSpan !style !msg = do
+ writeLogQueue log_queue (Just (flag,severity,srcSpan,style,msg))
-- Print each message from the log_queue using the log_action from the
-- session's DynFlags.
@@ -902,8 +902,8 @@ parUpsweep n_jobs old_hpt stable_mods cleanup sccs = do
print_loop [] = read_msgs
print_loop (x:xs) = case x of
- Just (severity,srcSpan,style,msg) -> do
- log_action dflags dflags severity srcSpan style msg
+ Just (flag,severity,srcSpan,style,msg) -> do
+ log_action dflags dflags flag severity srcSpan style msg
print_loop xs
-- Exit the loop once we encounter the end marker.
Nothing -> return ()