summaryrefslogtreecommitdiff
path: root/compiler/stgSyn/CoreToStg.hs
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2016-06-07 09:15:22 -0400
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2016-06-07 09:16:41 -0400
commitd05dee38c80e862d82e9ba891f3ae5076e376f31 (patch)
treeae4cc034ff8f54df097af0a97f63e195b4e646fa /compiler/stgSyn/CoreToStg.hs
parent7fea7121ce195e562a5443c0a8ef3861504ef1b3 (diff)
downloadhaskell-d05dee38c80e862d82e9ba891f3ae5076e376f31.tar.gz
CoreToStg: Remove hand-written Eq instances of HowBound and LetInfo
Diffstat (limited to 'compiler/stgSyn/CoreToStg.hs')
-rw-r--r--compiler/stgSyn/CoreToStg.hs16
1 files changed, 3 insertions, 13 deletions
diff --git a/compiler/stgSyn/CoreToStg.hs b/compiler/stgSyn/CoreToStg.hs
index c275f4d4f3..d2010a83d4 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]