Commit 69a804e3 authored by benl's avatar benl

Add more suppression flags

 -dsuppress-all
 -dsuppress-type-applications
 -dsuppress-idinfo
parent 10810bbd
......@@ -233,8 +233,13 @@ ppr_case_pat con args
where
ppr_bndr = pprBndr CaseBind
-- | Pretty print the argument in a function application.
pprArg :: OutputableBndr a => Expr a -> SDoc
pprArg (Type ty) = ptext (sLit "@") <+> pprParendType ty
pprArg (Type ty)
| opt_SuppressTypeApplications = empty
| otherwise = ptext (sLit "@") <+> pprParendType ty
pprArg expr = pprParendExpr expr
\end{code}
......@@ -325,6 +330,8 @@ pprIdBndrInfo info
\begin{code}
ppIdInfo :: Id -> IdInfo -> SDoc
ppIdInfo id info
| opt_SuppressIdInfo = empty
| otherwise
= showAttributes
[ (True, pp_scope <> ppr (idDetails id))
, (has_arity, ptext (sLit "Arity=") <> int arity)
......
......@@ -122,9 +122,12 @@ static_flags = [
------ Debugging ----------------------------------------------------
, Flag "dppr-debug" (PassFlag addOpt)
, Flag "dsuppress-all" (PassFlag addOpt)
, Flag "dsuppress-uniques" (PassFlag addOpt)
, Flag "dsuppress-coercions" (PassFlag addOpt)
, Flag "dsuppress-module-prefixes" (PassFlag addOpt)
, Flag "dsuppress-type-applications" (PassFlag addOpt)
, Flag "dsuppress-idinfo" (PassFlag addOpt)
, Flag "dppr-user-length" (AnySuffix addOpt)
, Flag "dopt-fuel" (AnySuffix addOpt)
, Flag "dtrace-level" (AnySuffix addOpt)
......
......@@ -21,9 +21,12 @@ module StaticFlags (
-- Output style options
opt_PprUserLength,
opt_SuppressAll,
opt_SuppressUniques,
opt_SuppressCoercions,
opt_SuppressModulePrefixes,
opt_SuppressTypeApplications,
opt_SuppressIdInfo,
opt_PprStyle_Debug, opt_TraceLevel,
opt_NoDebugOutput,
......@@ -181,15 +184,42 @@ unpacked_opts =
opt_IgnoreDotGhci :: Bool
opt_IgnoreDotGhci = lookUp (fsLit "-ignore-dot-ghci")
-- debugging opts
-- debugging options
-- | Suppress all that is suppressable in core dumps.
opt_SuppressAll :: Bool
opt_SuppressAll
= lookUp (fsLit "-dsuppress-all")
-- | Suppress unique ids on variables.
opt_SuppressUniques :: Bool
opt_SuppressUniques = lookUp (fsLit "-dsuppress-uniques")
opt_SuppressUniques
= lookUp (fsLit "-dsuppress-all")
|| lookUp (fsLit "-dsuppress-uniques")
-- | Suppress all coercions, them replacing with '...'
opt_SuppressCoercions :: Bool
opt_SuppressCoercions = lookUp (fsLit "-dsuppress-coercions")
opt_SuppressCoercions
= lookUp (fsLit "-dsuppress-all")
|| lookUp (fsLit "-dsuppress-coercions")
-- | Suppress module id prefixes on variables.
opt_SuppressModulePrefixes :: Bool
opt_SuppressModulePrefixes = lookUp (fsLit "-dsuppress-module-prefixes")
opt_SuppressModulePrefixes
= lookUp (fsLit "-dsuppress-all")
|| lookUp (fsLit "-dsuppress-module-prefixes")
-- | Suppress type applications.
opt_SuppressTypeApplications :: Bool
opt_SuppressTypeApplications
= lookUp (fsLit "-dsuppress-all")
|| lookUp (fsLit "-dsuppress-type-applications")
-- | Suppress info such as arity and unfoldings on identifiers.
opt_SuppressIdInfo :: Bool
opt_SuppressIdInfo
= lookUp (fsLit "-dsuppress-all")
|| lookUp (fsLit "-dsuppress-idinfo")
opt_PprStyle_Debug :: Bool
opt_PprStyle_Debug = lookUp (fsLit "-dppr-debug")
......
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