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