Commit ca816c6d authored by Simon Peyton Jones's avatar Simon Peyton Jones

Remove dead code: ruleLhsOrphNames

parent 0e169a8b
...@@ -24,7 +24,7 @@ module CoreFVs ( ...@@ -24,7 +24,7 @@ module CoreFVs (
idUnfoldingVars, idFreeVars, idRuleAndUnfoldingVars, idUnfoldingVars, idFreeVars, idRuleAndUnfoldingVars,
idRuleVars, idRuleRhsVars, stableUnfoldingVars, idRuleVars, idRuleRhsVars, stableUnfoldingVars,
ruleRhsFreeVars, ruleFreeVars, rulesFreeVars, ruleRhsFreeVars, ruleFreeVars, rulesFreeVars,
ruleLhsOrphNames, ruleLhsFreeIds, exprsOrphNames, ruleLhsFreeIds, exprsOrphNames,
vectsFreeVars, vectsFreeVars,
-- * Core syntax tree annotation with free variables -- * Core syntax tree annotation with free variables
...@@ -215,21 +215,6 @@ tickish_fvs _ = noVars ...@@ -215,21 +215,6 @@ tickish_fvs _ = noVars
************************************************************************ ************************************************************************
-} -}
-- | ruleLhsOrphNames is used when deciding whether
-- a rule is an orphan. In particular, suppose that T is defined in this
-- module; we want to avoid declaring that a rule like:
--
-- > fromIntegral T = fromIntegral_T
--
-- is an orphan. Of course it isn't, and declaring it an orphan would
-- make the whole module an orphan module, which is bad.
ruleLhsOrphNames :: CoreRule -> NameSet
ruleLhsOrphNames (BuiltinRule { ru_fn = fn }) = unitNameSet fn
ruleLhsOrphNames (Rule { ru_fn = fn, ru_args = tpl_args })
= extendNameSet (exprsOrphNames tpl_args) fn
-- No need to delete bndrs, because
-- exprsOrphNames finds only External names
-- | Finds the free /external/ names of an expression, notably -- | Finds the free /external/ names of an expression, notably
-- including the names of type constructors (which of course do not show -- including the names of type constructors (which of course do not show
-- up in 'exprFreeVars'). -- up in 'exprFreeVars').
......
...@@ -180,7 +180,6 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs ...@@ -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 -- A rule is an orphan only if none of the variables
-- mentioned on its left-hand side are locally defined -- mentioned on its left-hand side are locally defined
lhs_names = nameSetElems (extendNameSet (exprsOrphNames args) fn) lhs_names = nameSetElems (extendNameSet (exprsOrphNames args) fn)
-- TODO: copied from ruleLhsOrphNames
-- Since rules get eventually attached to one of the free names -- Since rules get eventually attached to one of the free names
-- from the definition when compiling the ABI hash, we should make -- from the definition when compiling the ABI hash, we should make
......
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