Commit 2d5be63d authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Ben Gamari
Browse files

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.


-dppr-ticks is still there, but deprecated.
parent 0aafe519
......@@ -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 ->
......@@ -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)
......@@ -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,
......@@ -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)
......@@ -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
......@@ -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
# 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
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