summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2018-02-20 13:19:19 -0500
committerBen Gamari <ben@smart-cactus.org>2018-02-25 16:25:19 -0500
commit3d43fd5b816a980d650d98f5822831dfce38f658 (patch)
tree169c8cc0b1a835589a4a3a1419ae30fed42cd1e0
parentcb89ba88d42ab77f9e20d722ec1ab40ec6f8e703 (diff)
downloadhaskell-3d43fd5b816a980d650d98f5822831dfce38f658.tar.gz
Introduce the flag -dsuppress-timestamps to avoid timestamps in dumps.
This makes it easier to diff dumps which are otherwise identical. Also updated the description of -dsuppress-all as parts of these also apply to stages other than core. Test Plan: Looking at dump result. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4429
-rw-r--r--compiler/main/DynFlags.hs8
-rw-r--r--compiler/main/ErrUtils.hs9
-rw-r--r--docs/users_guide/debugging.rst9
3 files changed, 20 insertions, 6 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 01432b6f89..b7720dde53 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -583,6 +583,7 @@ data GeneralFlag
| Opt_SuppressUniques
| Opt_SuppressStgFreeVars
| Opt_SuppressTicks -- Replaces Opt_PprShowTicks
+ | Opt_SuppressTimestamps -- ^ Suppress timestamps in dumps
-- temporary flags
| Opt_AutoLinkPackages
@@ -3040,7 +3041,8 @@ dynamic_flags_deps = [
setGeneralFlag Opt_SuppressIdInfo
setGeneralFlag Opt_SuppressTicks
setGeneralFlag Opt_SuppressStgFreeVars
- setGeneralFlag Opt_SuppressTypeSignatures)
+ setGeneralFlag Opt_SuppressTypeSignatures
+ setGeneralFlag Opt_SuppressTimestamps)
------ Debugging ----------------------------------------------------
, make_ord_flag defGhcFlag "dstg-stats"
@@ -3835,10 +3837,12 @@ dFlagsDeps = [
flagSpec "suppress-idinfo" Opt_SuppressIdInfo,
flagSpec "suppress-unfoldings" Opt_SuppressUnfoldings,
flagSpec "suppress-module-prefixes" Opt_SuppressModulePrefixes,
+ flagSpec "suppress-timestamps" Opt_SuppressTimestamps,
flagSpec "suppress-type-applications" Opt_SuppressTypeApplications,
flagSpec "suppress-type-signatures" Opt_SuppressTypeSignatures,
flagSpec "suppress-uniques" Opt_SuppressUniques,
- flagSpec "suppress-var-kinds" Opt_SuppressVarKinds]
+ flagSpec "suppress-var-kinds" Opt_SuppressVarKinds
+ ]
-- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@
fFlags :: [FlagSpec GeneralFlag]
diff --git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs
index 13ff017e09..c7fb8babe9 100644
--- a/compiler/main/ErrUtils.hs
+++ b/compiler/main/ErrUtils.hs
@@ -500,9 +500,12 @@ dumpSDoc dflags print_unqual flag hdr doc =
doc' <- if null hdr
then return doc
else do t <- getCurrentTime
- let d = text (show t)
- $$ blankLine
- $$ doc
+ let timeStamp = if (gopt Opt_SuppressTimestamps dflags)
+ then empty
+ else text (show t)
+ let d = timeStamp
+ $$ blankLine
+ $$ doc
return $ mkDumpDoc hdr d
defaultLogActionHPrintDoc dflags handle doc' dump_style
diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst
index cf926348a0..d11cc04fd0 100644
--- a/docs/users_guide/debugging.rst
+++ b/docs/users_guide/debugging.rst
@@ -612,7 +612,7 @@ are doing, not all of it will be useful. Use these flags to suppress the
parts that you are not interested in.
.. ghc-flag:: -dsuppress-all
- :shortdesc: In core dumps, suppress everything (except for uniques) that is
+ :shortdesc: In dumps, suppress everything (except for uniques) that is
suppressible.
:type: dynamic
@@ -663,6 +663,13 @@ parts that you are not interested in.
Suppress the printing of module qualification prefixes. This is the
``Data.List`` in ``Data.List.length``.
+.. ghc-flag:: -dsuppress-timestamps
+ :shortdesc: Suppress timestamps in dumps
+ :type: dynamic
+
+ Suppress the printing of timestamps.
+ This makes it easier to diff dumps.
+
.. ghc-flag:: -dsuppress-type-signatures
:shortdesc: Suppress type signatures
:type: dynamic