[commit: ghc] master: Filter orphan rules based on imports, fixes #10294 and #10420. (0cb1f5c)
git at git.haskell.org
git at git.haskell.org
Sat Jun 20 22:13:35 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0cb1f5cf26fae946ca745abc5e302e62a8f66feb/ghc
>---------------------------------------------------------------
commit 0cb1f5cf26fae946ca745abc5e302e62a8f66feb
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date: Wed Jun 3 14:33:05 2015 -0700
Filter orphan rules based on imports, fixes #10294 and #10420.
Summary:
If we have an orphan rule in our database, don't apply it
unless the defining module is transitively imported by the
module we are processing. We do this by defining a new RuleEnv
data type which includes both the RuleBase as well as the set
of visible orphan modules, and threading this through the
relevant environments (CoreReader, RuleCheckEnv and ScEnv).
This is analogous to the instances fix we applied in #2182
4c834fdddf4d44d12039da4d6a2c63a660975b95, but done for RULES.
An important knock-on effect is that we can remove some buggy
code in LoadInterface which tried to avoid loading interfaces
that were loaded by plugins (which sometimes caused instances
and rules to NEVER become visible).
One note about tests: I renamed the old plugins07 test to T10420
and replaced plugins07 with a test to ensure that a plugin
import did not cause new rules to be loaded in.
Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, goldfire
Subscribers: bgamari, thomie
Differential Revision: https://phabricator.haskell.org/D950
GHC Trac Issues: #10420
>---------------------------------------------------------------
0cb1f5cf26fae946ca745abc5e302e62a8f66feb
compiler/coreSyn/CoreFVs.hs | 2 +-
compiler/coreSyn/CoreLint.hs | 1 +
compiler/coreSyn/CoreSyn.hs | 116 ++++++++++++++++++++-
compiler/deSugar/Desugar.hs | 3 +-
compiler/deSugar/DsBinds.hs | 3 +-
compiler/iface/LoadIface.hs | 27 +----
compiler/iface/MkIface.hs | 24 ++---
compiler/iface/TcIface.hs | 5 +-
compiler/simplCore/CoreMonad.hs | 9 +-
compiler/simplCore/SimplCore.hs | 23 ++--
compiler/simplCore/SimplMonad.hs | 8 +-
compiler/specialise/Rules.hs | 38 +++++--
compiler/specialise/SpecConstr.hs | 14 ++-
compiler/specialise/Specialise.hs | 24 +++--
compiler/types/InstEnv.hs | 78 +-------------
testsuite/.gitignore | 4 +
testsuite/tests/plugins/Makefile | 19 +++-
testsuite/tests/plugins/T10294.hs | 7 ++
testsuite/tests/plugins/T10294.stderr | 1 +
testsuite/tests/plugins/T10294a.hs | 7 ++
.../tests/plugins/{plugins07.hs => T10420.hs} | 2 +-
.../plugins/{plugins07.stdout => T10420.stdout} | 0
.../tests/plugins/{Plugins07a.hs => T10420a.hs} | 2 +-
testsuite/tests/plugins/all.T | 21 +++-
.../p => plugins/annotation-plugin}/LICENSE | 0
.../Makefile | 0
.../tests/plugins/annotation-plugin/SayAnnNames.hs | 34 ++++++
.../cabal05 => plugins/annotation-plugin}/Setup.hs | 0
.../annotation-plugin/annotation-plugin.cabal | 11 ++
testsuite/tests/plugins/plugins07.hs | 4 -
testsuite/tests/plugins/plugins07.stdout | 2 +-
.../tests/simplCore/should_compile/T8848.stderr | 10 +-
32 files changed, 321 insertions(+), 178 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0cb1f5cf26fae946ca745abc5e302e62a8f66feb
More information about the ghc-commits
mailing list