Commit 4426c5ff authored by niteria's avatar niteria

Kill two instances of uniqSetToList

There should be no performance impact of switching to the
deterministic set here.

GHC Trac: #4012
parent d05dee38
......@@ -42,6 +42,7 @@ import FastString
import Outputable
import Platform
import UniqSet
import UniqFM
import Unique
import Util
......@@ -984,7 +985,7 @@ is_cishCC JavaScriptCallConv = False
--
pprTempAndExternDecls :: [CmmBlock] -> (SDoc{-temps-}, SDoc{-externs-})
pprTempAndExternDecls stmts
= (vcat (map pprTempDecl (uniqSetToList temps)),
= (pprUFM temps (vcat . map pprTempDecl),
vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls)))
where (temps, lbls) = runTE (mapM_ te_BB stmts)
......
......@@ -47,7 +47,6 @@ import Util
import ErrUtils
import SrcLoc
import qualified Maybes
import UniqSet
import UniqDSet
import FastString
import Platform
......@@ -576,7 +575,7 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods
-- 1. Find the dependent home-pkg-modules/packages from each iface
-- (omitting modules from the interactive package, which is already linked)
; (mods_s, pkgs_s) <- follow_deps (filterOut isInteractiveModule mods)
emptyUniqSet emptyUniqSet;
emptyUniqDSet emptyUniqDSet;
; let {
-- 2. Exclude ones already linked
......@@ -604,11 +603,11 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods
-- dependencies of that. Hence we need to traverse the dependency
-- tree recursively. See bug #936, testcase ghci/prog007.
follow_deps :: [Module] -- modules to follow
-> UniqSet ModuleName -- accum. module dependencies
-> UniqSet UnitId -- accum. package dependencies
-> UniqDSet ModuleName -- accum. module dependencies
-> UniqDSet UnitId -- accum. package dependencies
-> IO ([ModuleName], [UnitId]) -- result
follow_deps [] acc_mods acc_pkgs
= return (uniqSetToList acc_mods, uniqSetToList acc_pkgs)
= return (uniqDSetToList acc_mods, uniqDSetToList acc_pkgs)
follow_deps (mod:mods) acc_mods acc_pkgs
= do
mb_iface <- initIfaceCheck hsc_env $
......@@ -628,12 +627,12 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods
where is_boot (m,True) = Left m
is_boot (m,False) = Right m
boot_deps' = filter (not . (`elementOfUniqSet` acc_mods)) boot_deps
acc_mods' = addListToUniqSet acc_mods (moduleName mod : mod_deps)
acc_pkgs' = addListToUniqSet acc_pkgs $ map fst pkg_deps
boot_deps' = filter (not . (`elementOfUniqDSet` acc_mods)) boot_deps
acc_mods' = addListToUniqDSet acc_mods (moduleName mod : mod_deps)
acc_pkgs' = addListToUniqDSet acc_pkgs $ map fst pkg_deps
--
if pkg /= this_pkg
then follow_deps mods acc_mods (addOneToUniqSet acc_pkgs' pkg)
then follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' pkg)
else follow_deps (map (mkModule this_pkg) boot_deps' ++ mods)
acc_mods' acc_pkgs'
where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment