summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-02-17 14:50:59 +0000
committerBen Gamari <ben@smart-cactus.org>2017-02-20 13:33:12 -0500
commit2d5be63d1140a409eb18d1a77d439053844f7ce7 (patch)
tree788de731ff517049b1b0ed79bd4f21e67aacc3f1
parent0aafe5191c3c4b83cc414fb5cb31d2e6f100bee0 (diff)
downloadhaskell-2d5be63d1140a409eb18d1a77d439053844f7ce7.tar.gz
Change -dppr-ticks to -dsuppress-ticks
I spent about two hours today hunting fruitlessly for a simplifier bug (when fixing Trac #13255), only to find that it was caused by -ddump-X silently suppressing all ticks in Core. I think this has happened to me once before. So I've changed to make tick-printing on by default (like coercions, etc), with a flag -dsuppress-ticks (like -dsuppress-coercions) to suppress them. Blargh. -dppr-ticks is still there, but deprecated.
-rw-r--r--compiler/cmm/PprCmm.hs7
-rw-r--r--compiler/coreSyn/PprCore.hs6
-rw-r--r--compiler/main/DynFlags.hs8
-rw-r--r--compiler/stgSyn/StgSyn.hs6
-rw-r--r--docs/users_guide/debugging.rst8
-rw-r--r--testsuite/tests/codeGen/should_compile/Makefile4
6 files changed, 21 insertions, 18 deletions
diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs
index 089066a1ab..d20f013cb8 100644
--- a/compiler/cmm/PprCmm.hs
+++ b/compiler/cmm/PprCmm.hs
@@ -186,15 +186,14 @@ pprNode node = pp_node <+> pp_debug
-- label:
CmmEntry id tscope -> ppr id <> colon <+>
(sdocWithDynFlags $ \dflags ->
- ppWhen (gopt Opt_PprShowTicks dflags) (text "//" <+> ppr tscope))
+ ppUnless (gopt Opt_SuppressTicks dflags) (text "//" <+> ppr tscope))
-- // text
CmmComment s -> text "//" <+> ftext s
-- //tick bla<...>
- CmmTick t -> if gopt Opt_PprShowTicks dflags
- then text "//tick" <+> ppr t
- else empty
+ CmmTick t -> ppUnless (gopt Opt_SuppressTicks dflags) $
+ text "//tick" <+> ppr t
-- unwind reg = expr;
CmmUnwind regs ->
diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs
index a8dc2179a1..994c237529 100644
--- a/compiler/coreSyn/PprCore.hs
+++ b/compiler/coreSyn/PprCore.hs
@@ -274,9 +274,9 @@ ppr_expr add_par (Let bind expr)
ppr_expr add_par (Tick tickish expr)
= sdocWithDynFlags $ \dflags ->
- if gopt Opt_PprShowTicks dflags
- then add_par (sep [ppr tickish, pprCoreExpr expr])
- else ppr_expr add_par expr
+ if gopt Opt_SuppressTicks dflags
+ then ppr_expr add_par expr
+ else add_par (sep [ppr tickish, pprCoreExpr expr])
pprCoreAlt :: OutputableBndr a => (AltCon, [a] , Expr a) -> SDoc
pprCoreAlt (con, args, rhs)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index e04d40807f..d3d0ac34b7 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -545,6 +545,7 @@ data GeneralFlag
-- Except for uniques, as some simplifier phases introduce new
-- variables that have otherwise identical names.
| Opt_SuppressUniques
+ | Opt_SuppressTicks -- Replaces Opt_PprShowTicks
-- temporary flags
| Opt_AutoLinkPackages
@@ -2829,6 +2830,7 @@ dynamic_flags_deps = [
setGeneralFlag Opt_SuppressModulePrefixes
setGeneralFlag Opt_SuppressTypeApplications
setGeneralFlag Opt_SuppressIdInfo
+ setGeneralFlag Opt_SuppressTicks
setGeneralFlag Opt_SuppressTypeSignatures)
------ Debugging ----------------------------------------------------
@@ -3586,7 +3588,9 @@ dFlagsDeps = [
-- See Note [Supporting CLI completion]
-- Please keep the list of flags below sorted alphabetically
flagSpec "ppr-case-as-let" Opt_PprCaseAsLet,
- flagSpec "ppr-ticks" Opt_PprShowTicks,
+ depFlagSpec' "ppr-ticks" Opt_PprShowTicks
+ (\turn_on -> useInstead "suppress-ticks" (not turn_on)),
+ flagSpec "suppress-ticks" Opt_SuppressTicks,
flagSpec "suppress-coercions" Opt_SuppressCoercions,
flagSpec "suppress-idinfo" Opt_SuppressIdInfo,
flagSpec "suppress-unfoldings" Opt_SuppressUnfoldings,
@@ -3677,7 +3681,7 @@ fFlagsDeps = [
flagSpec "regs-graph" Opt_RegsGraph,
flagSpec "regs-iterative" Opt_RegsIterative,
depFlagSpec' "rewrite-rules" Opt_EnableRewriteRules
- (useInstead "enable-rewrite-rules"),
+ (useInstead "enable-rewrite-rules"),
flagSpec "shared-implib" Opt_SharedImplib,
flagSpec "spec-constr" Opt_SpecConstr,
flagSpec "specialise" Opt_Specialise,
diff --git a/compiler/stgSyn/StgSyn.hs b/compiler/stgSyn/StgSyn.hs
index 93b6e76264..15181f3e5d 100644
--- a/compiler/stgSyn/StgSyn.hs
+++ b/compiler/stgSyn/StgSyn.hs
@@ -766,9 +766,9 @@ pprStgExpr (StgLetNoEscape bind expr)
pprStgExpr (StgTick tickish expr)
= sdocWithDynFlags $ \dflags ->
- if gopt Opt_PprShowTicks dflags
- then sep [ ppr tickish, pprStgExpr expr ]
- else pprStgExpr expr
+ if gopt Opt_SuppressTicks dflags
+ then pprStgExpr expr
+ else sep [ ppr tickish, pprStgExpr expr ]
pprStgExpr (StgCase expr bndr alt_type alts)
diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst
index fc634d0d47..fd4adc7d20 100644
--- a/docs/users_guide/debugging.rst
+++ b/docs/users_guide/debugging.rst
@@ -267,10 +267,6 @@ Dumping out compiler intermediate structures
aren't). This flag makes debugging output appear in the more verbose
debug style.
-.. ghc-flag:: -dppr-ticks
-
- Includes "ticks" in the pretty-printer output.
-
.. _formatting dumps:
@@ -323,6 +319,10 @@ parts that you are not interested in.
this often makes the printout ambiguous. If you just want to see the
overall structure of the code, then start here.
+.. ghc-flag:: -dsuppress-ticks
+
+ Suppress "ticks" in the pretty-printer output.
+
.. ghc-flag:: -dsuppress-uniques
Suppress the printing of uniques. This may make the printout
diff --git a/testsuite/tests/codeGen/should_compile/Makefile b/testsuite/tests/codeGen/should_compile/Makefile
index fda9c9490e..a3e03d244b 100644
--- a/testsuite/tests/codeGen/should_compile/Makefile
+++ b/testsuite/tests/codeGen/should_compile/Makefile
@@ -9,13 +9,13 @@ debug:
# Without optimisations, we should get annotations for basically
# all expressions in the example program.
echo == Dbg ==
- '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -dppr-ticks -ddump-cmm-verbose \
+ '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -ddump-cmm-verbose \
| grep -o src\<debug.hs:.*\> | sort -u
./debug
# With optimisations we will get fewer annotations.
echo == Dbg -O2 ==
- '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -dppr-ticks -ddump-cmm-verbose -O2 \
+ '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -ddump-cmm-verbose -O2 \
> debug.cmm
cat debug.cmm | grep -o src\<debug.hs:.*\> | sort -u