Commit ac97c15c authored by rl@cse.unsw.edu.au's avatar rl@cse.unsw.edu.au
Browse files

New flag -dsuppress-coercions to avoid printing coercions in Core dumps

parent 81e1bfd2
......@@ -27,6 +27,7 @@ import DataCon
import TyCon
import Type
import Coercion
import StaticFlags
import BasicTypes
import Util
import Outputable
......@@ -114,9 +115,11 @@ ppr_expr _ (Lit lit) = ppr lit
ppr_expr add_par (Cast expr co)
= add_par $
sep [pprParendExpr expr,
ptext (sLit "`cast`") <+> parens (pprCo co)]
ptext (sLit "`cast`") <+> pprCo co]
where
pprCo co = sep [ppr co, dcolon <+> ppr (coercionKindPredTy co)]
pprCo co | opt_SuppressCoercions = ptext (sLit "...")
| otherwise = parens
$ sep [ppr co, dcolon <+> ppr (coercionKindPredTy co)]
ppr_expr add_par expr@(Lam _ _)
......
......@@ -120,6 +120,7 @@ static_flags = [
------ Debugging ----------------------------------------------------
, Flag "dppr-debug" (PassFlag addOpt) Supported
, Flag "dsuppress-uniques" (PassFlag addOpt) Supported
, Flag "dsuppress-coercions" (PassFlag addOpt) Supported
, Flag "dppr-user-length" (AnySuffix addOpt) Supported
, Flag "dopt-fuel" (AnySuffix addOpt) Supported
, Flag "dno-debug-output" (PassFlag addOpt) Supported
......
......@@ -22,6 +22,7 @@ module StaticFlags (
-- Output style options
opt_PprUserLength,
opt_SuppressUniques,
opt_SuppressCoercions,
opt_PprStyle_Debug,
opt_NoDebugOutput,
......@@ -182,6 +183,8 @@ opt_IgnoreDotGhci = lookUp (fsLit "-ignore-dot-ghci")
-- debugging opts
opt_SuppressUniques :: Bool
opt_SuppressUniques = lookUp (fsLit "-dsuppress-uniques")
opt_SuppressCoercions :: Bool
opt_SuppressCoercions = lookUp (fsLit "-dsuppress-coercions")
opt_PprStyle_Debug :: Bool
opt_PprStyle_Debug = lookUp (fsLit "-dppr-debug")
opt_PprUserLength :: Int
......
......@@ -435,6 +435,17 @@
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-dsuppress-coercions</option>
<indexterm><primary><option>-dsuppress-coercions</option></primary></indexterm>
</term>
<listitem>
<para>Suppress the printing of coercions in Core dumps to make them
shorter.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-dppr-user-length</option>
......
......@@ -2306,6 +2306,12 @@
<entry>static</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-dsuppress-coercions</option></entry>
<entry>Suppress the printing of coercions in Core dumps to make them shorter.</entry>
<entry>static</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-dppr-noprags</option></entry>
<entry>Don't output pragma info in dumps</entry>
......
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