[commit: ghc] master: Remove -dtrace-level (48876ae)
git at git.haskell.org
git at git.haskell.org
Wed Oct 26 15:50:21 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/48876ae04c4963f8d5a60a121ac85d52322faaee/ghc
>---------------------------------------------------------------
commit 48876ae04c4963f8d5a60a121ac85d52322faaee
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date: Wed Oct 26 11:20:06 2016 -0400
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
>---------------------------------------------------------------
48876ae04c4963f8d5a60a121ac85d52322faaee
compiler/main/DynFlags.hs | 4 ----
compiler/rename/RnTypes.hs | 3 +++
compiler/typecheck/TcRnMonad.hs | 6 ++----
compiler/typecheck/TcSMonad.hs | 18 +++++++++---------
compiler/vectorise/Vectorise/Monad/Base.hs | 4 +---
5 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index cd8dc41..ffebf3b 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -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.
diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs
index 870baad..56a0331 100644
--- a/compiler/rename/RnTypes.hs
+++ b/compiler/rename/RnTypes.hs
@@ -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 }
diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs
index e2c5938..e4fdd9c 100644
--- a/compiler/typecheck/TcRnMonad.hs
+++ b/compiler/typecheck/TcRnMonad.hs
@@ -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
diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs
index 6e04e2c..a362cef 100644
--- a/compiler/typecheck/TcSMonad.hs
+++ b/compiler/typecheck/TcSMonad.hs
@@ -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
diff --git a/compiler/vectorise/Vectorise/Monad/Base.hs b/compiler/vectorise/Vectorise/Monad/Base.hs
index b084da6..a612a9c 100644
--- a/compiler/vectorise/Vectorise/Monad/Base.hs
+++ b/compiler/vectorise/Vectorise/Monad/Base.hs
@@ -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.
--
More information about the ghc-commits
mailing list