Reduce non-determinism in ABI hashes with RULES and instance decls
authorBartosz Nitka <niteria@gmail.com>
Fri, 17 Jul 2015 15:50:52 +0000 (16:50 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 17 Jul 2015 15:51:18 +0000 (16:51 +0100)
commit3448f9827d2364b91bc60134aa38b74849b9d54e
tree6d818b58b8547eabbe42777b47f6cf0042c2fb35
parenta5e9da8feb5110ab8ee8fe3821e6b6d53946f983
Reduce non-determinism in ABI hashes with RULES and instance decls

Summary:
Before this change the `RULES` would be attached to one for the names from
the module that appear on the left hand side. The choice depended on the
`uniq` that was generated, which are known to be non-deterministic (a
separate, bigger problem). Now we use `OccName`s which should be stable.

Analogously for instance declarations, but they are attached to one of
the types involved.

Test Plan:
contbuild
it made `Data.Text.Internal.Fusion.Common` interface stable, previously
stream fusion rule would be attached either to `streamList` or
`unstreamList` depending on if the module was compiled after `cabal
clean` or after `find | grep '\.o$' | xargs rm`.

Reviewers: simonpj, austin, bgamari, simonmar

Subscribers: puffnfresh, thomie

Differential Revision: https://phabricator.haskell.org/D1073

GHC Trac Issues: #4012
compiler/specialise/Rules.hs
compiler/types/InstEnv.hs