diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2013-12-17 16:34:28 +0100 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2013-12-17 16:34:28 +0100 |
commit | 82dfe08d43e5cb9617fbc056fd3359b514414413 (patch) | |
tree | 5978d2790a2653465807425aec7cdec080bc047b | |
parent | ddd1c8209a69b9ed1cdad2a9b47a7e47bbd4bc96 (diff) | |
download | haskell-82dfe08d43e5cb9617fbc056fd3359b514414413.tar.gz |
Remove unused eqExprX
-rw-r--r-- | compiler/coreSyn/CoreUtils.lhs | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs index bb7b3e231a..ea2e17fb04 100644 --- a/compiler/coreSyn/CoreUtils.lhs +++ b/compiler/coreSyn/CoreUtils.lhs @@ -31,7 +31,7 @@ module CoreUtils ( CoreStats(..), coreBindsStats, -- * Equality - cheapEqExpr, eqExpr, eqExprX, + cheapEqExpr, eqExpr, -- * Eta reduction tryEtaReduce, @@ -1330,43 +1330,18 @@ exprIsBig _ = True eqExpr :: InScopeSet -> CoreExpr -> CoreExpr -> Bool -- Compares for equality, modulo alpha eqExpr in_scope e1 e2 - = eqExprX id_unf (mkRnEnv2 in_scope) e1 e2 - where - id_unf _ = noUnfolding -- Don't expand -\end{code} - -\begin{code} -eqExprX :: IdUnfoldingFun -> RnEnv2 -> CoreExpr -> CoreExpr -> Bool --- ^ Compares expressions for equality, modulo alpha. --- Does /not/ look through newtypes or predicate types --- Used in rule matching, and also CSE - -eqExprX id_unfolding_fun env e1 e2 - = go env e1 e2 + = go (mkRnEnv2 in_scope) e1 e2 where go env (Var v1) (Var v2) | rnOccL env v1 == rnOccR env v2 = True - -- The next two rules expand non-local variables - -- C.f. Note [Expanding variables] in Rules.lhs - -- and Note [Do not expand locally-bound variables] in Rules.lhs - go env (Var v1) e2 - | not (locallyBoundL env v1) - , Just e1' <- expandUnfolding_maybe (id_unfolding_fun (lookupRnInScope env v1)) - = go (nukeRnEnvL env) e1' e2 - - go env e1 (Var v2) - | not (locallyBoundR env v2) - , Just e2' <- expandUnfolding_maybe (id_unfolding_fun (lookupRnInScope env v2)) - = go (nukeRnEnvR env) e1 e2' - go _ (Lit lit1) (Lit lit2) = lit1 == lit2 go env (Type t1) (Type t2) = eqTypeX env t1 t2 go env (Coercion co1) (Coercion co2) = coreEqCoercion2 env co1 co2 go env (Cast e1 co1) (Cast e2 co2) = coreEqCoercion2 env co1 co2 && go env e1 e2 go env (App f1 a1) (App f2 a2) = go env f1 f2 && go env a1 a2 - go env (Tick n1 e1) (Tick n2 e2) = go_tickish n1 n2 && go env e1 e2 + go env (Tick n1 e1) (Tick n2 e2) = go_tickish env n1 n2 && go env e1 e2 go env (Lam b1 e1) (Lam b2 e2) = eqTypeX env (varType b1) (varType b2) -- False for Id/TyVar combination @@ -1396,20 +1371,11 @@ eqExprX id_unfolding_fun env e1 e2 = c1 == c2 && go (rnBndrs2 env bs1 bs2) e1 e2 ----------- - go_tickish (Breakpoint lid lids) (Breakpoint rid rids) + go_tickish env (Breakpoint lid lids) (Breakpoint rid rids) = lid == rid && map (rnOccL env) lids == map (rnOccR env) rids - go_tickish l r = l == r -\end{code} - -Auxiliary functions - -\begin{code} -locallyBoundL, locallyBoundR :: RnEnv2 -> Var -> Bool -locallyBoundL rn_env v = inRnEnvL rn_env v -locallyBoundR rn_env v = inRnEnvR rn_env v + go_tickish _ l r = l == r \end{code} - %************************************************************************ %* * \subsection{The size of an expression} |