diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-06-21 12:28:23 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-06-21 12:29:15 +0100 |
commit | 861b7a5be1f8fbcb19477e8c21d18f2cf589b703 (patch) | |
tree | b4563aa661b9a265aeb0c22dd18fd770c9eedaee /compiler/GHC/Stg/Syntax.hs | |
parent | a0622459f1d9a7068e81b8a707ffc63e153444f8 (diff) | |
download | haskell-wip/t20009.tar.gz |
ghci: Correct free variable calculation in StgToByteCodewip/t20009
Fixes #20019
Diffstat (limited to 'compiler/GHC/Stg/Syntax.hs')
-rw-r--r-- | compiler/GHC/Stg/Syntax.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs index a1a1084166..b0c32470f5 100644 --- a/compiler/GHC/Stg/Syntax.hs +++ b/compiler/GHC/Stg/Syntax.hs @@ -50,7 +50,7 @@ module GHC.Stg.Syntax ( StgOp(..), -- utils - stgRhsArity, + stgRhsArity, freeVarsOfRhs, isDllConApp, stgArgType, stripStgTicksTop, stripStgTicksTopE, @@ -504,6 +504,10 @@ stgRhsArity (StgRhsClosure _ _ _ bndrs _) -- The arity never includes type parameters, but they should have gone by now stgRhsArity (StgRhsCon _ _ _ _ _) = 0 +freeVarsOfRhs :: (XRhsClosure pass ~ DIdSet) => GenStgRhs pass -> DIdSet +freeVarsOfRhs (StgRhsCon _ _ _ _ args) = mkDVarSet [ id | StgVarArg id <- args ] +freeVarsOfRhs (StgRhsClosure fvs _ _ _ _) = fvs + {- ************************************************************************ * * |