summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2020-03-13 18:39:10 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-14 19:36:04 -0400
commit1de3ab4a147eeb0b34b24a3c0e91f174e6e5cb79 (patch)
tree548bcaaeaa701e5b11d6dedf1f89509a031d3360
parent49e9d7395a13584f15798bce1601b8d3a6633f11 (diff)
downloadhaskell-1de3ab4a147eeb0b34b24a3c0e91f174e6e5cb79.tar.gz
Remove unused field var_inline (#17915)
-rw-r--r--compiler/GHC/Hs/Binds.hs4
-rw-r--r--compiler/GHC/Hs/Utils.hs2
-rw-r--r--compiler/GHC/HsToCore/Binds.hs7
-rw-r--r--compiler/typecheck/TcHsSyn.hs5
-rw-r--r--testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr49
5 files changed, 23 insertions, 44 deletions
diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs
index 6fabd4e748..3c815821f5 100644
--- a/compiler/GHC/Hs/Binds.hs
+++ b/compiler/GHC/Hs/Binds.hs
@@ -276,9 +276,7 @@ data HsBindLR idL idR
| VarBind {
var_ext :: XVarBind idL idR,
var_id :: IdP idL,
- var_rhs :: LHsExpr idR, -- ^ Located only for consistency
- var_inline :: Bool -- ^ True <=> inline this binding regardless
- -- (used for implication constraints only)
+ var_rhs :: LHsExpr idR -- ^ Located only for consistency
}
-- | Abstraction Bindings
diff --git a/compiler/GHC/Hs/Utils.hs b/compiler/GHC/Hs/Utils.hs
index ff1af93a6d..b1bdb089cf 100644
--- a/compiler/GHC/Hs/Utils.hs
+++ b/compiler/GHC/Hs/Utils.hs
@@ -824,7 +824,7 @@ mkHsVarBind loc var rhs = mkSimpleGeneratedFunBind loc var [] rhs
mkVarBind :: IdP (GhcPass p) -> LHsExpr (GhcPass p) -> LHsBind (GhcPass p)
mkVarBind var rhs = L (getLoc rhs) $
VarBind { var_ext = noExtField,
- var_id = var, var_rhs = rhs, var_inline = False }
+ var_id = var, var_rhs = rhs }
mkPatSynBind :: Located RdrName -> HsPatSynDetails (Located RdrName)
-> LPat GhcPs -> HsPatSynDir GhcPs -> HsBind GhcPs
diff --git a/compiler/GHC/HsToCore/Binds.hs b/compiler/GHC/HsToCore/Binds.hs
index a80b2cc2d3..9c65603d53 100644
--- a/compiler/GHC/HsToCore/Binds.hs
+++ b/compiler/GHC/HsToCore/Binds.hs
@@ -135,14 +135,11 @@ dsHsBind :: DynFlags
-- bindings and their desugared right hand sides.
dsHsBind dflags (VarBind { var_id = var
- , var_rhs = expr
- , var_inline = inline_regardless })
+ , var_rhs = expr })
= do { core_expr <- dsLExpr expr
-- Dictionary bindings are always VarBinds,
-- so we only need do this here
- ; let var' | inline_regardless = var `setIdUnfolding` mkCompulsoryUnfolding core_expr
- | otherwise = var
- ; let core_bind@(id,_) = makeCorePair dflags var' False 0 core_expr
+ ; let core_bind@(id,_) = makeCorePair dflags var False 0 core_expr
force_var = if xopt LangExt.Strict dflags
then [id]
else []
diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs
index d9626c2854..7fbed31dff 100644
--- a/compiler/typecheck/TcHsSyn.hs
+++ b/compiler/typecheck/TcHsSyn.hs
@@ -553,13 +553,12 @@ zonk_bind env bind@(PatBind { pat_lhs = pat, pat_rhs = grhss
, pat_ext = NPatBindTc fvs new_ty }) }
zonk_bind env (VarBind { var_ext = x
- , var_id = var, var_rhs = expr, var_inline = inl })
+ , var_id = var, var_rhs = expr })
= do { new_var <- zonkIdBndr env var
; new_expr <- zonkLExpr env expr
; return (VarBind { var_ext = x
, var_id = new_var
- , var_rhs = new_expr
- , var_inline = inl }) }
+ , var_rhs = new_expr }) }
zonk_bind env bind@(FunBind { fun_id = L loc var
, fun_matches = ms
diff --git a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
index 3654edfa45..80fc356925 100644
--- a/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
@@ -66,8 +66,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -132,8 +131,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -198,8 +196,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: GHC.Types.krep$*})))))
- (False)))
+ {Var: GHC.Types.krep$*})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -264,8 +261,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -330,8 +326,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -352,8 +347,7 @@
(SourceText
"2")
(False)
- (2)))))))
- (False)))
+ (2)))))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -374,8 +368,7 @@
(SourceText
"1")
(False)
- (1)))))))
- (False)))
+ (1)))))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -396,8 +389,7 @@
(SourceText
"0")
(False)
- (0)))))))
- (False)))
+ (0)))))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -421,8 +413,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -446,8 +437,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: GHC.Types.krep$*})))))
- (False)))
+ {Var: GHC.Types.krep$*})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -471,8 +461,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -496,8 +485,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -521,8 +509,7 @@
(HsVar
(NoExtField)
({ <no location info> }
- {Var: $krep})))))
- (False)))
+ {Var: $krep})))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -623,8 +610,7 @@
[]))
(HsConLikeOut
(NoExtField)
- ({abstract:ConLike})))))))))))))))))))
- (False)))
+ ({abstract:ConLike})))))))))))))))))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -653,8 +639,7 @@
[]))
(HsConLikeOut
(NoExtField)
- ({abstract:ConLike})))))))
- (False)))
+ ({abstract:ConLike})))))))))
,({ <no location info> }
(VarBind
(NoExtField)
@@ -700,8 +685,7 @@
(NoExtField)
(HsStringPrim
(NoSourceText)
- "DumpTypecheckedAst")))))))))
- (False)))
+ "DumpTypecheckedAst")))))))))))
,({ DumpTypecheckedAst.hs:18:1-23 }
(AbsBinds
(NoExtField)
@@ -767,3 +751,4 @@
[]))]}
(False)))]}
+