summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-07-01 07:29:08 -0700
committerBartosz Nitka <niteria@gmail.com>2016-07-01 07:30:16 -0700
commit0d522b80bc9d3cfc2b23a3a4d9092e08f006054e (patch)
treed815d1186d2d60953d15de1fdcf7167e13da9569
parentcbfeff4b3caade8092c13f0f71371e6525ece9ac (diff)
downloadhaskell-0d522b80bc9d3cfc2b23a3a4d9092e08f006054e.tar.gz
Document some benign nondeterminism
-rw-r--r--compiler/main/TidyPgm.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs
index aed985d71b..c02c786ed5 100644
--- a/compiler/main/TidyPgm.hs
+++ b/compiler/main/TidyPgm.hs
@@ -57,6 +57,7 @@ import Maybes
import UniqSupply
import ErrUtils (Severity(..))
import Outputable
+import UniqFM
import SrcLoc
import qualified ErrUtils as Err
@@ -484,7 +485,10 @@ tidyVectInfo (_, var_env) info@(VectInfo { vectInfoVar = vars
-- we only export mappings whose domain and co-domain is exported (otherwise, the iface is
-- inconsistent)
tidy_vars = mkVarEnv [ (tidy_var, (tidy_var, tidy_var_v))
- | (var, var_v) <- varEnvElts vars
+ | (var, var_v) <- nonDetEltsUFM vars
+ -- It's OK to use nonDetEltsUFM here because we
+ -- immediately forget the ordering by creating
+ -- a new env
, let tidy_var = lookup_var var
tidy_var_v = lookup_var var_v
, isExternalId tidy_var && isExportedId tidy_var
@@ -658,7 +662,9 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_
isJust $ collectStaticPtrSatArgs e
rule_rhs_vars = mapUnionVarSet ruleRhsFreeVars imp_id_rules
- vect_var_vs = mkVarSet [var_v | (var, var_v) <- nameEnvElts vect_vars, isGlobalId var]
+ vect_var_vs = mkVarSet [var_v | (var, var_v) <- nonDetEltsUFM vect_vars, isGlobalId var]
+ -- It's OK to use nonDetEltsUFM here because we immediately forget the
+ -- ordering by creating a set
flatten_binds = flattenBinds binds
binders = map fst flatten_binds