diff options
Diffstat (limited to 'compiler/GHC/Stg')
-rw-r--r-- | compiler/GHC/Stg/Lift/Analysis.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/Stg/Syntax.hs | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/Stg/Lift/Analysis.hs b/compiler/GHC/Stg/Lift/Analysis.hs index d4e59a8d6e..5999104c9c 100644 --- a/compiler/GHC/Stg/Lift/Analysis.hs +++ b/compiler/GHC/Stg/Lift/Analysis.hs @@ -115,9 +115,6 @@ type instance XRhsClosure 'LiftLams = DIdSet type instance XLet 'LiftLams = Skeleton type instance XLetNoEscape 'LiftLams = Skeleton -freeVarsOfRhs :: (XRhsClosure pass ~ DIdSet) => GenStgRhs pass -> DIdSet -freeVarsOfRhs (StgRhsCon _ _ _ _ args) = mkDVarSet [ id | StgVarArg id <- args ] -freeVarsOfRhs (StgRhsClosure fvs _ _ _ _) = fvs -- | Captures details of the syntax tree relevant to the cost model, such as -- closures, multi-shot lambdas and case expressions. 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 + {- ************************************************************************ * * |