summaryrefslogtreecommitdiff
path: root/compiler/specialise
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-09-05 15:53:15 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-09-05 16:03:20 +0100
commit1152a3bee1aef3e24a03e0c2e4e5272ca926f7ab (patch)
tree29135fd1238c11989e39fb6659f1619210c69046 /compiler/specialise
parente29ac2db000efead4610b3ce674aa3d0060238cf (diff)
downloadhaskell-1152a3bee1aef3e24a03e0c2e4e5272ca926f7ab.tar.gz
Define activeAfterInitial, activeDuringFinal
This is pure refactoring, just adding a couple of definitions to BasicTypes, and using them. Plus some whitespace stuff.
Diffstat (limited to 'compiler/specialise')
-rw-r--r--compiler/specialise/Rules.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index 4a4abf768b..ad6a0757cb 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -55,7 +55,7 @@ import NameSet
import NameEnv
import UniqFM
import Unify ( ruleMatchTyKiX )
-import BasicTypes ( Activation, CompilerPhase, isActive, pprRuleName )
+import BasicTypes
import DynFlags ( DynFlags )
import Outputable
import FastString
@@ -290,9 +290,10 @@ addRuleInfo (RuleInfo rs1 fvs1) (RuleInfo rs2 fvs2)
= RuleInfo (rs1 ++ rs2) (fvs1 `unionDVarSet` fvs2)
addIdSpecialisations :: Id -> [CoreRule] -> Id
-addIdSpecialisations id []
- = id
addIdSpecialisations id rules
+ | null rules
+ = id
+ | otherwise
= setIdSpecialisation id $
extendRuleInfo (idSpecialisation id) rules
@@ -312,9 +313,8 @@ ruleIsVisible _ BuiltinRule{} = True
ruleIsVisible vis_orphs Rule { ru_orphan = orph, ru_origin = origin }
= notOrphan orph || origin `elemModuleSet` vis_orphs
-{-
-Note [Where rules are found]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{- Note [Where rules are found]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The rules for an Id come from two places:
(a) the ones it is born with, stored inside the Id iself (idCoreRules fn),
(b) rules added in other modules, stored in the global RuleBase (imp_rules)