Commit 48876ae0 authored by Matthew Pickering's avatar Matthew Pickering Committed by Ben Gamari

Remove -dtrace-level

The flag was:

1. Not documented.
2. Only used as a boolean flag.
3. Has overlapping functionality with -dno-debug-output
4. My poll of #ghc concluded that people didn't know it existed.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2627

GHC Trac Issues: #12691
parent 23143f60
......@@ -856,7 +856,6 @@ data DynFlags = DynFlags {
-- Output style options
pprUserLength :: Int,
pprCols :: Int,
traceLevel :: Int, -- Standard level is 1. Less verbose is 0.
useUnicode :: Bool,
......@@ -1601,7 +1600,6 @@ defaultDynFlags mySettings =
pprUserLength = 5,
pprCols = 100,
useUnicode = False,
traceLevel = 1,
profAuto = NoProfAuto,
interactivePrint = Nothing,
nextWrapperNum = panic "defaultDynFlags: No nextWrapperNum",
......@@ -2640,8 +2638,6 @@ dynamic_flags_deps = [
d { pprUserLength = n }))
, make_ord_flag defFlag "dppr-cols" (intSuffix (\n d ->
d { pprCols = n }))
, make_ord_flag defGhcFlag "dtrace-level" (intSuffix (\n d ->
d { traceLevel = n }))
-- Suppress all that is suppressable in core dumps.
-- Except for uniques, as some simplifier phases introduce new variables that
-- have otherwise identical names.
......
......@@ -267,6 +267,9 @@ rnImplicitBndrs no_implicit_if_forall free_vars hs_ty@(L loc _) thing_inside
real_rdrs = freeKiTyVarsKindVars free_vars ++ real_tv_rdrs
; traceRn "rnSigType" (ppr hs_ty $$ ppr free_vars $$
ppr real_rdrs)
; traceRn "" (text "rnSigType2" <+> ppr hs_ty $$ ppr free_vars $$
ppr real_rdrs)
; vars <- mapM (newLocalBndrRn . L loc . unLoc) real_rdrs
; bindLocalNamesFV vars $
thing_inside vars }
......
......@@ -669,12 +669,10 @@ traceRn :: String -> SDoc -> TcRn ()
traceRn =
guardedTraceOptTcRn Opt_D_dump_rn_trace
-- | Do not display a trace if `-dno-debug-output` is on or `-dtrace-level=0`.
-- | Do not display a trace if `-dno-debug-output` is on
guardedTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn ()
guardedTraceOptTcRn flag herald doc = do
dflags <- getDynFlags
when ( traceLevel dflags >= 1
&& not opt_NoDebugOutput)
unless opt_NoDebugOutput
( traceOptTcRn flag (formatTraceMsg herald doc) )
formatTraceMsg :: String -> SDoc -> SDoc
......
......@@ -2424,12 +2424,12 @@ bumpStepCountTcS = TcS $ \env -> do { let ref = tcs_count env
csTraceTcS :: SDoc -> TcS ()
csTraceTcS doc
= wrapTcS $ csTraceTcM 1 (return doc)
= wrapTcS $ csTraceTcM (return doc)
traceFireTcS :: CtEvidence -> SDoc -> TcS ()
-- Dump a rule-firing trace
traceFireTcS ev doc
= TcS $ \env -> csTraceTcM 1 $
= TcS $ \env -> csTraceTcM $
do { n <- TcM.readTcRef (tcs_count env)
; tclvl <- TcM.getTcLevel
; return (hang (int n <> brackets (text "U:" <> ppr tclvl
......@@ -2437,14 +2437,14 @@ traceFireTcS ev doc
<+> doc <> colon)
4 (ppr ev)) }
csTraceTcM :: Int -> TcM SDoc -> TcM ()
csTraceTcM :: TcM SDoc -> TcM ()
-- Constraint-solver tracing, -ddump-cs-trace
csTraceTcM trace_level mk_doc
csTraceTcM mk_doc
= do { dflags <- getDynFlags
; when ( (dopt Opt_D_dump_cs_trace dflags || dopt Opt_D_dump_tc_trace dflags)
&& trace_level <= traceLevel dflags ) $
do { msg <- mk_doc
; TcM.traceTcRn Opt_D_dump_cs_trace msg } }
; when ( dopt Opt_D_dump_cs_trace dflags
|| dopt Opt_D_dump_tc_trace dflags )
( do { msg <- mk_doc
; TcM.traceTcRn Opt_D_dump_cs_trace msg }) }
runTcS :: TcS a -- What to run
-> TcM (a, EvBindMap)
......@@ -2489,7 +2489,7 @@ runTcSWithEvBinds solve_deriveds ev_binds_var tcs
; count <- TcM.readTcRef step_count
; when (count > 0) $
csTraceTcM 0 $ return (text "Constraint solver steps =" <+> int count)
csTraceTcM $ return (text "Constraint solver steps =" <+> int count)
#ifdef DEBUG
; ev_binds <- TcM.getTcEvBindsMap ev_binds_var
......
......@@ -123,9 +123,7 @@ emitVt herald doc
--
traceVt :: String -> SDoc -> VM ()
traceVt herald doc
= do dflags <- getDynFlags
when (1 <= traceLevel dflags) $
liftDs $ traceOptIf Opt_D_dump_vt_trace $ hang (text herald) 2 doc
= liftDs $ traceOptIf Opt_D_dump_vt_trace $ hang (text herald) 2 doc
-- |Dump the given program conditionally.
--
......
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