[commit: ghc] master: CoreToStg: Remove hand-written Eq instances of HowBound and LetInfo (d05dee3)

git at git.haskell.org git at git.haskell.org
Tue Jun 7 13:13:05 UTC 2016


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

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

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

commit d05dee38c80e862d82e9ba891f3ae5076e376f31
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Tue Jun 7 09:15:22 2016 -0400

    CoreToStg: Remove hand-written Eq instances of HowBound and LetInfo


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

d05dee38c80e862d82e9ba891f3ae5076e376f31
 compiler/stgSyn/CoreToStg.hs | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/compiler/stgSyn/CoreToStg.hs b/compiler/stgSyn/CoreToStg.hs
index c275f4d..d2010a8 100644
--- a/compiler/stgSyn/CoreToStg.hs
+++ b/compiler/stgSyn/CoreToStg.hs
@@ -856,10 +856,12 @@ data HowBound
         Arity           -- Its arity (local Ids don't have arity info at this point)
 
   | LambdaBound         -- Used for both lambda and case
+  deriving (Eq)
 
 data LetInfo
   = TopLet              -- top level things
   | NestedLet
+  deriving (Eq)
 
 isLetBound :: HowBound -> Bool
 isLetBound (LetBound _ _) = True
@@ -1010,21 +1012,9 @@ plusFVInfo :: (Var, HowBound, StgBinderInfo)
            -> (Var, HowBound, StgBinderInfo)
            -> (Var, HowBound, StgBinderInfo)
 plusFVInfo (id1,hb1,info1) (id2,hb2,info2)
-  = ASSERT(id1 == id2 && hb1 `check_eq_how_bound` hb2)
+  = ASSERT(id1 == id2 && hb1 == hb2)
     (id1, hb1, combineStgBinderInfo info1 info2)
 
--- The HowBound info for a variable in the FVInfo should be consistent
-check_eq_how_bound :: HowBound -> HowBound -> Bool
-check_eq_how_bound ImportBound        ImportBound        = True
-check_eq_how_bound LambdaBound        LambdaBound        = True
-check_eq_how_bound (LetBound li1 ar1) (LetBound li2 ar2) = ar1 == ar2 && check_eq_li li1 li2
-check_eq_how_bound _                  _                  = False
-
-check_eq_li :: LetInfo -> LetInfo -> Bool
-check_eq_li NestedLet NestedLet = True
-check_eq_li TopLet    TopLet    = True
-check_eq_li _         _         = False
-
 -- Misc.
 
 filterStgBinders :: [Var] -> [Var]



More information about the ghc-commits mailing list