ghc-7.0.4: The GHC API

CoreUnfold

Synopsis

- data Unfolding
- data UnfoldingGuidance
- noUnfolding :: Unfolding
- mkImplicitUnfolding :: CoreExpr -> Unfolding
- mkUnfolding :: UnfoldingSource -> Bool -> Bool -> CoreExpr -> Unfolding
- mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> Arity -> UnfoldingGuidance -> Unfolding
- mkTopUnfolding :: Bool -> CoreExpr -> Unfolding
- mkSimpleUnfolding :: CoreExpr -> Unfolding
- mkInlineUnfolding :: Maybe Arity -> CoreExpr -> Unfolding
- mkInlinableUnfolding :: CoreExpr -> Unfolding
- mkWwInlineRule :: Id -> CoreExpr -> Arity -> Unfolding
- mkCompulsoryUnfolding :: CoreExpr -> Unfolding
- mkDFunUnfolding :: Type -> [DFunArg CoreExpr] -> Unfolding
- interestingArg :: CoreExpr -> ArgSummary
- data ArgSummary
  - = TrivArg
  - | NonTrivArg
  - | ValueArg
- couldBeSmallEnoughToInline :: Int -> CoreExpr -> Bool
- certainlyWillInline :: Unfolding -> Bool
- smallEnoughToInline :: Unfolding -> Bool
- callSiteInline :: DynFlags -> Id -> Bool -> Bool -> [ArgSummary] -> CallCtxt -> Maybe CoreExpr
- data CallCtxt
  - = BoringCtxt
  - | ArgCtxt Bool
  - | ValAppCtxt
  - | CaseCtxt
- exprIsConApp_maybe :: IdUnfoldingFun -> CoreExpr -> Maybe (DataCon, [Type], [CoreExpr])

# Documentation

data Unfolding Source

Records the unfolding of an identifier, which is approximately the form the identifier would have if we substituted its definition in for the identifier. This type should be treated as abstract everywhere except in CoreUnfold

Instances

Outputable Unfolding |

data UnfoldingGuidance Source

`UnfoldingGuidance` says when unfolding should take place

Instances

Outputable UnfoldingGuidance |

noUnfolding :: Unfolding Source

There is no known `Unfolding`

mkImplicitUnfolding :: CoreExpr -> Unfolding Source

mkUnfolding :: UnfoldingSource -> Bool -> Bool -> CoreExpr -> Unfolding Source

mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> Arity -> UnfoldingGuidance -> Unfolding Source

mkTopUnfolding :: Bool -> CoreExpr -> Unfolding Source

mkSimpleUnfolding :: CoreExpr -> Unfolding Source

mkInlineUnfolding :: Maybe Arity -> CoreExpr -> Unfolding Source

mkInlinableUnfolding :: CoreExpr -> Unfolding Source

mkWwInlineRule :: Id -> CoreExpr -> Arity -> Unfolding Source

mkCompulsoryUnfolding :: CoreExpr -> Unfolding Source

mkDFunUnfolding :: Type -> [DFunArg CoreExpr] -> Unfolding Source

interestingArg :: CoreExpr -> ArgSummary Source

data ArgSummary Source

Constructors

TrivArg |
NonTrivArg |
ValueArg |

Instances

Outputable ArgSummary |

couldBeSmallEnoughToInline :: Int -> CoreExpr -> Bool Source

certainlyWillInline :: Unfolding -> Bool Source

smallEnoughToInline :: Unfolding -> Bool Source

callSiteInline :: DynFlags -> Id -> Bool -> Bool -> [ArgSummary] -> CallCtxt -> Maybe CoreExpr Source

data CallCtxt Source

Constructors

BoringCtxt |
ArgCtxt Bool |
ValAppCtxt |
CaseCtxt |

Instances

Outputable CallCtxt |

exprIsConApp_maybe :: IdUnfoldingFun -> CoreExpr -> Maybe (DataCon, [Type], [CoreExpr])Source

Returns `Just (dc, [t1..tk], [x1..xn])` if the argument expression is a *saturated* constructor application of the form `dc t1..tk x1 .. xn`, where t1..tk are the *universally-qantified* type args of `dc`