diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2017-03-29 16:08:40 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-29 16:08:45 -0400 |
commit | 04ea4c3f86db4e2cc7b2683f58f2076233039ebf (patch) | |
tree | 08e034753aaeca0fff496b5f7f0832fac149b7e1 /compiler/specialise | |
parent | 5856c564dff79a5c2b6a92b1c6c350798b538da3 (diff) | |
download | haskell-04ea4c3f86db4e2cc7b2683f58f2076233039ebf.tar.gz |
Print module when dumping rules
It is sometimes hard to find where a rule is defined. Printing the
module where it comes from will make it much easier to find.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3378
Diffstat (limited to 'compiler/specialise')
-rw-r--r-- | compiler/specialise/Rules.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index 1dcff82f24..83b4e8dd9c 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -263,7 +263,7 @@ pprRulesForUser :: DynFlags -> [CoreRule] -> SDoc pprRulesForUser dflags rules = withPprStyle (defaultUserStyle dflags) $ pprRules $ - sortBy (comparing ru_name) $ + sortBy (comparing ruleName) $ tidyRules emptyTidyEnv rules {- @@ -420,7 +420,7 @@ findBest target (rule1,ans1) ((rule2,ans2):prs) | rule2 `isMoreSpecific` rule1 = findBest target (rule2,ans2) prs | debugIsOn = let pp_rule rule = sdocWithPprDebug $ \dbg -> if dbg then ppr rule - else doubleQuotes (ftext (ru_name rule)) + else doubleQuotes (ftext (ruleName rule)) in pprTrace "Rules.findBest: rule overlap (Rule 1 wins)" (vcat [ sdocWithPprDebug $ \dbg -> if dbg then text "Expression to match:" <+> ppr fn |