summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg/Lint.hs
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2023-04-11 06:07:35 +0000
committerJosh Meredith <joshmeredith2008@gmail.com>2023-04-26 10:35:06 +0000
commiteba7b247f31a420cae64d0ee87d7296bf434724e (patch)
treeff20a73518f78cfa52a6cd7c2b956b98d8a1dd33 /compiler/GHC/Stg/Lint.hs
parent74c557121fbcae32abd3b4a69513f8aa7d536073 (diff)
downloadhaskell-wip/js-stgrhsclosure.tar.gz
Refactor GenStgRhs to include the Type in both constructors (#23280, #22576, #22364)wip/js-stgrhsclosure
Carry the actual type of an expression through the PreStgRhs and into GenStgRhs for use in later stages. Currently this is used in the JavaScript backend to fix some tests from the above mentioned issues: EtaExpandLevPoly, RepPolyWrappedVar2, T13822, T14749.
Diffstat (limited to 'compiler/GHC/Stg/Lint.hs')
-rw-r--r--compiler/GHC/Stg/Lint.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs
index 535c16f3a8..8315e185e0 100644
--- a/compiler/GHC/Stg/Lint.hs
+++ b/compiler/GHC/Stg/Lint.hs
@@ -222,25 +222,25 @@ checkNoCurrentCCS rhs = do
opts <- getStgPprOpts
let rhs' = pprStgRhs opts rhs
case rhs of
- StgRhsClosure _ ccs _ _ _
+ StgRhsClosure _ ccs _ _ _ _
| isCurrentCCS ccs
-> addErrL (text "Top-level StgRhsClosure with CurrentCCS" $$ rhs')
- StgRhsCon ccs _ _ _ _
+ StgRhsCon ccs _ _ _ _ _
| isCurrentCCS ccs
-> addErrL (text "Top-level StgRhsCon with CurrentCCS" $$ rhs')
_ -> return ()
lintStgRhs :: (OutputablePass a, BinderP a ~ Id) => GenStgRhs a -> LintM ()
-lintStgRhs (StgRhsClosure _ _ _ [] expr)
+lintStgRhs (StgRhsClosure _ _ _ [] expr _)
= lintStgExpr expr
-lintStgRhs (StgRhsClosure _ _ _ binders expr)
+lintStgRhs (StgRhsClosure _ _ _ binders expr _)
= addLoc (LambdaBodyOf binders) $
addInScopeVars binders $
lintStgExpr expr
-lintStgRhs rhs@(StgRhsCon _ con _ _ args) = do
+lintStgRhs rhs@(StgRhsCon _ con _ _ args _) = do
opts <- getStgPprOpts
when (isUnboxedTupleDataCon con || isUnboxedSumDataCon con) $ do
addErrL (text "StgRhsCon is an unboxed tuple or sum application" $$