projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6c9db8f
)
More refactoring in getCoreToDo
author
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Wed, 9 Jan 2008 02:37:47 +0000
(
02:37
+0000)
committer
Roman Leshchinskiy
<rl@cse.unsw.edu.au>
Wed, 9 Jan 2008 02:37:47 +0000
(
02:37
+0000)
compiler/main/DynFlags.hs
patch
|
blob
|
history
diff --git
a/compiler/main/DynFlags.hs
b/compiler/main/DynFlags.hs
index
359ea39
..
e9681f6
100644
(file)
--- a/
compiler/main/DynFlags.hs
+++ b/
compiler/main/DynFlags.hs
@@
-774,6
+774,10
@@
runWhen :: Bool -> CoreToDo -> CoreToDo
runWhen True do_this = do_this
runWhen False do_this = CoreDoNothing
runWhen True do_this = do_this
runWhen False do_this = CoreDoNothing
+runMaybe :: Maybe a -> (a -> CoreToDo) -> CoreToDo
+runMaybe (Just x) f = f x
+runMaybe Nothing _ = CoreDoNothing
+
getCoreToDo :: DynFlags -> [CoreToDo]
getCoreToDo dflags
| Just todo <- coreToDo dflags = todo -- set explicitly by user
getCoreToDo :: DynFlags -> [CoreToDo]
getCoreToDo dflags
| Just todo <- coreToDo dflags = todo -- set explicitly by user
@@
-790,8
+794,7
@@
getCoreToDo dflags
rule_check = ruleCheck dflags
vectorisation = dopt Opt_Vectorise dflags
rule_check = ruleCheck dflags
vectorisation = dopt Opt_Vectorise dflags
- maybe_rule_check phase | Just s <- rule_check = CoreDoRuleCheck phase s
- | otherwise = CoreDoNothing
+ maybe_rule_check phase = runMaybe rule_check (CoreDoRuleCheck phase)
simpl_phase phase iter = CoreDoPasses
[ CoreDoSimplify (SimplPhase phase) [
simpl_phase phase iter = CoreDoPasses
[ CoreDoSimplify (SimplPhase phase) [
@@
-842,7
+845,7
@@
getCoreToDo dflags
-- We run vectorisation here for now, but we might also try to run
-- it later
-- We run vectorisation here for now, but we might also try to run
-- it later
- runWhen vectorisation (CoreDoPasses [ CoreDoVectorisation, simpl_gently]),
+ runWhen vectorisation (CoreDoPasses [ CoreDoVectorisation, simpl_gently ]),
-- Specialisation is best done before full laziness
-- so that overloaded functions have all their dictionary lambdas manifest
-- Specialisation is best done before full laziness
-- so that overloaded functions have all their dictionary lambdas manifest