[commit: ghc] master: Remove dead code: ruleLhsOrphNames (ca816c6)

git at git.haskell.org git at git.haskell.org
Tue Oct 6 10:38:20 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ca816c6db6c9cbce4cf1670a791dd541c3edf771/ghc

>---------------------------------------------------------------

commit ca816c6db6c9cbce4cf1670a791dd541c3edf771
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Oct 6 09:53:07 2015 +0100

    Remove dead code: ruleLhsOrphNames


>---------------------------------------------------------------

ca816c6db6c9cbce4cf1670a791dd541c3edf771
 compiler/coreSyn/CoreFVs.hs  | 17 +----------------
 compiler/specialise/Rules.hs |  1 -
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs
index f5f58dc..af4197e 100644
--- a/compiler/coreSyn/CoreFVs.hs
+++ b/compiler/coreSyn/CoreFVs.hs
@@ -24,7 +24,7 @@ module CoreFVs (
         idUnfoldingVars, idFreeVars, idRuleAndUnfoldingVars,
         idRuleVars, idRuleRhsVars, stableUnfoldingVars,
         ruleRhsFreeVars, ruleFreeVars, rulesFreeVars,
-        ruleLhsOrphNames, ruleLhsFreeIds, exprsOrphNames,
+        ruleLhsFreeIds, exprsOrphNames,
         vectsFreeVars,
 
         -- * Core syntax tree annotation with free variables
@@ -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
 -- including the names of type constructors (which of course do not show
 -- up in 'exprFreeVars').
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index dd48832..d6a56d6 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -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



More information about the ghc-commits mailing list