summaryrefslogtreecommitdiff
path: root/compiler/GHC.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-05 20:44:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-11 20:33:37 -0400
commita6989971379c26d8c288551d536149675e009e34 (patch)
tree3cf1f5db8494cb6408461679dc9bcd9f4d5a938d /compiler/GHC.hs
parentbc41e47123b205a45385a3aa69de97ce22686423 (diff)
downloadhaskell-a6989971379c26d8c288551d536149675e009e34.tar.gz
Use a Set to represent Ways
Should make `member` queries faster and avoid messing up with missing `nubSort`. Metric Increase: hie002
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r--compiler/GHC.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index 256a414e64..11c1ce8521 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -336,6 +336,7 @@ import GHC.Driver.Finder
import GHC.Driver.Types
import GHC.Driver.CmdLine
import GHC.Driver.Session hiding (WarnReason(..))
+import GHC.Driver.Ways
import SysTools
import SysTools.BaseDir
import Annotations
@@ -365,6 +366,7 @@ import FileCleanup
import Data.Foldable
import qualified Data.Map.Strict as Map
import Data.Set (Set)
+import qualified Data.Set as S
import qualified Data.Sequence as Seq
import Data.Maybe
import Data.Time
@@ -542,10 +544,10 @@ checkBrokenTablesNextToCode dflags
checkBrokenTablesNextToCode' :: MonadIO m => DynFlags -> m Bool
checkBrokenTablesNextToCode' dflags
- | not (isARM arch) = return False
- | WayDyn `notElem` ways dflags = return False
- | not (tablesNextToCode dflags) = return False
- | otherwise = do
+ | not (isARM arch) = return False
+ | WayDyn `S.notMember` ways dflags = return False
+ | not (tablesNextToCode dflags) = return False
+ | otherwise = do
linkerInfo <- liftIO $ getLinkerInfo dflags
case linkerInfo of
GnuLD _ -> return True
@@ -605,9 +607,9 @@ setSessionDynFlags dflags = do
let
prog = pgm_i dflags ++ flavour
flavour
- | WayProf `elem` ways dflags = "-prof"
- | WayDyn `elem` ways dflags = "-dyn"
- | otherwise = ""
+ | WayProf `S.member` ways dflags = "-prof"
+ | WayDyn `S.member` ways dflags = "-dyn"
+ | otherwise = ""
msg = text "Starting " <> text prog
tr <- if verbosity dflags >= 3
then return (logInfo dflags (defaultDumpStyle dflags) msg)
@@ -617,7 +619,7 @@ setSessionDynFlags dflags = do
{ iservConfProgram = prog
, iservConfOpts = getOpts dflags opt_i
, iservConfProfiled = gopt Opt_SccProfilingOn dflags
- , iservConfDynamic = WayDyn `elem` ways dflags
+ , iservConfDynamic = WayDyn `S.member` ways dflags
, iservConfHook = createIservProcessHook (hooks dflags)
, iservConfTrace = tr
}