[commit: ghc] master: Annotation linting (07d604f)
git at git.haskell.org
git at git.haskell.org
Tue Dec 16 21:02:12 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/07d604fa1dba7caa39cdc4bc3d90844c600adb70/ghc
>---------------------------------------------------------------
commit 07d604fa1dba7caa39cdc4bc3d90844c600adb70
Author: Peter Wortmann <scpmw at leeds.ac.uk>
Date: Tue Oct 14 00:09:59 2014 +0200
Annotation linting
This adds a way by which we can make sure that the Core passes treat
annotations right: We run them twice and compare the results.
The main problem here is that Core equivalence is awkward: We do not
want the comparison to care about the order of, say, top-level or
recursive bindings. This is important even if GHC generally generates
the bindings in the right order - after all, if something goes wrong
we don't want linting to dump out the whole program as the offense.
So instead we do some heuristic matching - first greedily match
everything that's easy, then match the rest by label order. This
should work as long as GHC generates the labels in roughly the same
order for both pass runs. In practice it seems to work alright.
We also check that IdInfos match, as this might cause hard-to-spot
bugs down the line (I had at least one bug because unfolding guidance
didn't match!). We especially check unfoldings up until the point
where it might get us into an infinite loop.
(From Phabricator D169)
>---------------------------------------------------------------
07d604fa1dba7caa39cdc4bc3d90844c600adb70
compiler/basicTypes/BasicTypes.hs | 3 +
compiler/coreSyn/CoreLint.hs | 64 ++++++++++++++++
compiler/coreSyn/CoreSyn.hs | 1 +
compiler/coreSyn/CoreUtils.hs | 155 ++++++++++++++++++++++++++++++++++++--
compiler/main/DynFlags.hs | 3 +
compiler/simplCore/SimplCore.hs | 5 +-
6 files changed, 224 insertions(+), 7 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 07d604fa1dba7caa39cdc4bc3d90844c600adb70
More information about the ghc-commits
mailing list