summaryrefslogtreecommitdiff
path: root/compiler/specialise
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-06-02 09:39:47 -0700
committerBartosz Nitka <niteria@gmail.com>2016-06-02 09:50:02 -0700
commitcb9f635eae76c61f189b9b55af4ed7628ccafda1 (patch)
treeb4ba1924dc672115bcb174ec93bc4ffaddc74979 /compiler/specialise
parent940229c280fcc986003ad60d3ff2a2643c7c4363 (diff)
downloadhaskell-cb9f635eae76c61f189b9b55af4ed7628ccafda1.tar.gz
Localize orphan-related nondeterminism
chooseOrphanAnchor now takes a NameSet, relieving the callers from the burden of converting it to a list Test Plan: ./validate Reviewers: bgamari, ezyang, austin, simonmar, simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2294 GHC Trac Issues: #4012
Diffstat (limited to 'compiler/specialise')
-rw-r--r--compiler/specialise/Rules.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index e11de97902..48684240d6 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -181,13 +181,13 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs
-- Compute orphanhood. See Note [Orphans] in InstEnv
-- A rule is an orphan only if none of the variables
-- mentioned on its left-hand side are locally defined
- lhs_names = nameSetElems (extendNameSet (exprsOrphNames args) fn)
+ lhs_names = extendNameSet (exprsOrphNames args) fn
-- Since rules get eventually attached to one of the free names
-- from the definition when compiling the ABI hash, we should make
-- it deterministic. This chooses the one with minimal OccName
-- as opposed to uniq value.
- local_lhs_names = filter (nameIsLocalOrFrom this_mod) lhs_names
+ local_lhs_names = filterNameSet (nameIsLocalOrFrom this_mod) lhs_names
orph = chooseOrphanAnchor local_lhs_names
--------------