ghc-9.6.4: The GHC API
Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file LICENSE)
MaintainerJeffrey Young <jeffrey.young@iohk.io> Luite Stegeman <luite.stegeman@iohk.io> Sylvain Henry <sylvain.henry@iohk.io> Josh Meredith <josh.meredith@iohk.io>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.StgToJS.ExprCtx

Description

 
Synopsis

Documentation

data ExprCtx Source #

Context into which an expression is evaluated

initExprCtx :: Id -> ExprCtx Source #

Initialize an expression context in the context of the given top-level binding Id

ctxAssertEvaluated :: Id -> ExprCtx -> ExprCtx Source #

Add an Id to the known-evaluated set

ctxIsEvaluated :: ExprCtx -> Id -> Bool Source #

Predicate: do we know for sure that the given Id is evaluated?

ctxSetSrcSpan :: RealSrcSpan -> ExprCtx -> ExprCtx Source #

Set source location

ctxSetTop :: Id -> ExprCtx -> ExprCtx Source #

Set top-level binding Id

ctxTarget :: ExprCtx -> [TypedExpr] Source #

Target variables for the evaluated expression

ctxEvaluatedIds :: ExprCtx -> UniqSet Id Source #

Ids that we know to be evaluated (e.g. case binders when the expression to evaluate is in an alternative)

Let-no-escape

ctxClearLneFrame :: ExprCtx -> ExprCtx Source #

Remove information about the current LNE frame

ctxUpdateLneFrame :: [(Id, Int)] -> [Id] -> ExprCtx -> ExprCtx Source #

Update let-no-escape frame

ctxLneFrameVars :: ExprCtx -> [(Id, Int)] Source #

Contents of current LNE frame

Variables and their index on the stack

ctxIsLneBinding :: ExprCtx -> Id -> Bool Source #

Does the given Id correspond to a LNE binding

ctxIsLneLiveVar :: ExprCtx -> Id -> Bool Source #

Does the given Id correspond to a LNE live var on the stack

ctxLneBindingStackSize :: ExprCtx -> Id -> Maybe Int Source #

Return the LNE stack size associated to the given Id. Return Nothing when the Id doesn't correspond to a LNE binding.

ctxLneShrinkStack :: ExprCtx -> Int -> ExprCtx Source #

Shrink the LNE stack to the given size