diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-17 15:32:32 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-01 10:37:39 -0400 |
commit | f8386c7b6a9d26bc5fd2c1d74d944c8df6337690 (patch) | |
tree | 2160d6880a430f07f4a0ac7a58b0355afe139649 /compiler/GHC/Core/Rules.hs | |
parent | 780de9e11014a88a4f676eb296c30fec2b07b5c2 (diff) | |
download | haskell-f8386c7b6a9d26bc5fd2c1d74d944c8df6337690.tar.gz |
Refactor PprDebug handling
If `-dppr-debug` is set, then PprUser and PprDump styles are silently
replaced with PprDebug style. This was done in `mkUserStyle` and
`mkDumpStyle` smart constructors. As a consequence they needed a
DynFlags parameter.
Now we keep the original PprUser and PprDump styles until they are used
to create an `SDocContext`. I.e. the substitution is only performed in
`initSDocContext`.
Diffstat (limited to 'compiler/GHC/Core/Rules.hs')
-rw-r--r-- | compiler/GHC/Core/Rules.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Core/Rules.hs b/compiler/GHC/Core/Rules.hs index 4989b22ff0..668f273a1f 100644 --- a/compiler/GHC/Core/Rules.hs +++ b/compiler/GHC/Core/Rules.hs @@ -260,14 +260,14 @@ functions (lambdas) except by name, so in this case it seems like a good idea to treat 'M.k' as a roughTopName of the call. -} -pprRulesForUser :: DynFlags -> [CoreRule] -> SDoc +pprRulesForUser :: [CoreRule] -> SDoc -- (a) tidy the rules -- (b) sort them into order based on the rule name -- (c) suppress uniques (unless -dppr-debug is on) -- This combination makes the output stable so we can use in testing -- It's here rather than in GHC.Core.Ppr because it calls tidyRules -pprRulesForUser dflags rules - = withPprStyle (defaultUserStyle dflags) $ +pprRulesForUser rules + = withPprStyle defaultUserStyle $ pprRules $ sortBy (comparing ruleName) $ tidyRules emptyTidyEnv rules |