summaryrefslogtreecommitdiff
path: root/compiler/specialise/Rules.hs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
committerAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
commit5a1b4f814f74ec1c48152d97523744518e212777 (patch)
tree7c2207ecacbd37f12c78dbcf9d4334827164e0fb /compiler/specialise/Rules.hs
parent6757950cdd8bb0af0355539987ee78401a6a8f6b (diff)
parent808bbdf08058785ae5bc59b5b4f2b04951d4cbbf (diff)
downloadhaskell-wip/orf-reboot.tar.gz
Merge remote-tracking branch 'origin/master' into wip/orf-rebootwip/orf-reboot
Conflicts: compiler/rename/RnNames.hs compiler/typecheck/TcRnMonad.hs utils/haddock
Diffstat (limited to 'compiler/specialise/Rules.hs')
-rw-r--r--compiler/specialise/Rules.hs29
1 files changed, 14 insertions, 15 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index dd48832864..9b5d3cf763 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -16,8 +16,8 @@ module Rules (
-- ** Checking rule applications
ruleCheckProgram,
- -- ** Manipulating 'SpecInfo' rules
- mkSpecInfo, extendSpecInfo, addSpecInfo,
+ -- ** Manipulating 'RuleInfo' rules
+ mkRuleInfo, extendRuleInfo, addRuleInfo,
addIdSpecialisations,
-- * Misc. CoreRule helpers
@@ -43,7 +43,7 @@ import TysPrim ( anyTypeOfKind )
import Coercion
import CoreTidy ( tidyRules )
import Id
-import IdInfo ( SpecInfo( SpecInfo ) )
+import IdInfo ( RuleInfo( RuleInfo ) )
import Var
import VarEnv
import VarSet
@@ -180,7 +180,6 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs
-- A rule is an orphan only if none of the variables
-- mentioned on its left-hand side are locally defined
lhs_names = nameSetElems (extendNameSet (exprsOrphNames args) fn)
- -- TODO: copied from ruleLhsOrphNames
-- Since rules get eventually attached to one of the free names
-- from the definition when compiling the ABI hash, we should make
@@ -268,30 +267,30 @@ pprRulesForUser rules
{-
************************************************************************
* *
- SpecInfo: the rules in an IdInfo
+ RuleInfo: the rules in an IdInfo
* *
************************************************************************
-}
--- | Make a 'SpecInfo' containing a number of 'CoreRule's, suitable
+-- | Make a 'RuleInfo' containing a number of 'CoreRule's, suitable
-- for putting into an 'IdInfo'
-mkSpecInfo :: [CoreRule] -> SpecInfo
-mkSpecInfo rules = SpecInfo rules (rulesFreeVars rules)
+mkRuleInfo :: [CoreRule] -> RuleInfo
+mkRuleInfo rules = RuleInfo rules (rulesFreeVars rules)
-extendSpecInfo :: SpecInfo -> [CoreRule] -> SpecInfo
-extendSpecInfo (SpecInfo rs1 fvs1) rs2
- = SpecInfo (rs2 ++ rs1) (rulesFreeVars rs2 `unionVarSet` fvs1)
+extendRuleInfo :: RuleInfo -> [CoreRule] -> RuleInfo
+extendRuleInfo (RuleInfo rs1 fvs1) rs2
+ = RuleInfo (rs2 ++ rs1) (rulesFreeVars rs2 `unionVarSet` fvs1)
-addSpecInfo :: SpecInfo -> SpecInfo -> SpecInfo
-addSpecInfo (SpecInfo rs1 fvs1) (SpecInfo rs2 fvs2)
- = SpecInfo (rs1 ++ rs2) (fvs1 `unionVarSet` fvs2)
+addRuleInfo :: RuleInfo -> RuleInfo -> RuleInfo
+addRuleInfo (RuleInfo rs1 fvs1) (RuleInfo rs2 fvs2)
+ = RuleInfo (rs1 ++ rs2) (fvs1 `unionVarSet` fvs2)
addIdSpecialisations :: Id -> [CoreRule] -> Id
addIdSpecialisations id []
= id
addIdSpecialisations id rules
= setIdSpecialisation id $
- extendSpecInfo (idSpecialisation id) rules
+ extendRuleInfo (idSpecialisation id) rules
-- | Gather all the rules for locally bound identifiers from the supplied bindings
rulesOfBinds :: [CoreBind] -> [CoreRule]