Commit 1c886ead authored by Matthew Pickering's avatar Matthew Pickering

Stop -dno-debug-output suppressing -ddump-tc-trace

The user manual states that -dno-debug-output should suppress
*unsolicited* debugging output which essentially amounts to calls
to `pprTrace`. Before I unified the interface of `traceTc` and
`traceRn`, the flag suppressed calls to `traceTc` but not to `traceRn`
or any other tracing function already controlled by a flag.

Thus, in order to make the behaviour more uniform, it seemed best to
remove this one special case.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12691
parent 1cab42d8
......@@ -662,18 +662,18 @@ updTcRef ref fn = liftIO $ do { old <- readIORef ref
-- Typechecker trace
traceTc :: String -> SDoc -> TcRn ()
traceTc =
guardedTraceOptTcRn Opt_D_dump_tc_trace
labelledTraceOptTcRn Opt_D_dump_tc_trace
-- Renamer Trace
traceRn :: String -> SDoc -> TcRn ()
traceRn =
guardedTraceOptTcRn Opt_D_dump_rn_trace
labelledTraceOptTcRn Opt_D_dump_rn_trace
-- | Do not display a trace if `-dno-debug-output` is on
guardedTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn ()
guardedTraceOptTcRn flag herald doc = do
unless opt_NoDebugOutput
( traceOptTcRn flag (formatTraceMsg herald doc) )
-- | Trace when a certain flag is enabled. This is like `traceOptTcRn`
-- but accepts a string as a label and formats the trace message uniformly.
labelledTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn ()
labelledTraceOptTcRn flag herald doc = do
traceOptTcRn flag (formatTraceMsg herald doc)
formatTraceMsg :: String -> SDoc -> SDoc
formatTraceMsg herald doc = hang (text herald) 2 doc
• Could not deduce (C x0 (F x0))
• Could not deduce (C x0 (F x0))
• Could not deduce (C x0 (F x0))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment