diff options
Diffstat (limited to 'compiler/main/TidyPgm.hs')
-rw-r--r-- | compiler/main/TidyPgm.hs | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs index c02c786ed5..915cd12450 100644 --- a/compiler/main/TidyPgm.hs +++ b/compiler/main/TidyPgm.hs @@ -57,7 +57,7 @@ import Maybes import UniqSupply import ErrUtils (Severity(..)) import Outputable -import UniqFM +import UniqDFM import SrcLoc import qualified ErrUtils as Err @@ -484,17 +484,14 @@ tidyVectInfo (_, var_env) info@(VectInfo { vectInfoVar = vars where -- 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) <- 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 - , isExternalId tidy_var_v && isExportedId tidy_var_v - , isDataConWorkId var || not (isImplicitId var) - ] + tidy_vars = mkDVarEnv [ (tidy_var, (tidy_var, tidy_var_v)) + | (var, var_v) <- eltsUDFM vars + , let tidy_var = lookup_var var + tidy_var_v = lookup_var var_v + , isExternalId tidy_var && isExportedId tidy_var + , isExternalId tidy_var_v && isExportedId tidy_var_v + , isDataConWorkId var || not (isImplicitId var) + ] tidy_parallelVars = mkDVarSet [ tidy_var @@ -625,7 +622,7 @@ chooseExternalIds :: HscEnv -> [CoreBind] -> [CoreBind] -> [CoreRule] - -> VarEnv (Var, Var) + -> DVarEnv (Var, Var) -> IO (UnfoldEnv, TidyOccEnv) -- Step 1 from the notes above @@ -662,9 +659,7 @@ 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) <- nonDetEltsUFM vect_vars, isGlobalId var] - -- It's OK to use nonDetEltsUFM here because we immediately forget the - -- ordering by creating a set + vect_var_vs = mkVarSet [var_v | (var, var_v) <- eltsUDFM vect_vars, isGlobalId var] flatten_binds = flattenBinds binds binders = map fst flatten_binds @@ -716,7 +711,7 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_ | otherwise = addExternal expose_all refined_id -- add vectorised version if any exists - new_ids' = new_ids ++ maybeToList (fmap snd $ lookupVarEnv vect_vars idocc) + new_ids' = new_ids ++ maybeToList (fmap snd $ lookupDVarEnv vect_vars idocc) -- 'idocc' is an *occurrence*, but we need to see the -- unfolding in the *definition*; so look up in binder_set |