ghc-7.8.4: The GHC API

Safe Haskell | None
Language | Haskell98

StgCmmMonad

# Documentation

data FCode a

Instances

Monad FCode |
Functor FCode |
Applicative FCode |
HasDynFlags FCode |

initC :: IO CgState

runC :: DynFlags -> Module -> CgState -> FCode a -> (a, CgState)

thenC :: FCode () -> FCode a -> FCode a infixr 9

thenFC :: FCode a -> (a -> FCode c) -> FCode c infixr 9

listCs :: [FCode ()] -> FCode ()

returnFC :: a -> FCode a

fixC :: (a -> FCode a) -> FCode a

newUnique :: FCode Unique

newUniqSupply :: FCode UniqSupply

newLabelC :: FCode BlockId

emitLabel :: BlockId -> FCode ()

emit :: CmmAGraph -> FCode ()

emitDecl :: CmmDecl -> FCode ()

emitProc :: Maybe CmmInfoTable -> CLabel -> [GlobalReg] -> CmmAGraph -> Int -> FCode ()

emitProcWithConvention :: Convention -> Maybe CmmInfoTable -> CLabel -> [CmmFormal] -> CmmAGraph -> FCode ()

emitProcWithStackFrame :: Convention -> Maybe CmmInfoTable -> CLabel -> [CmmFormal] -> [CmmFormal] -> CmmAGraph -> Bool -> FCode ()

emitOutOfLine :: BlockId -> CmmAGraph -> FCode ()

emitAssign :: CmmReg -> CmmExpr -> FCode ()

emitStore :: CmmExpr -> CmmExpr -> FCode ()

emitComment :: FastString -> FCode ()

getCmm :: FCode () -> FCode CmmGroup

aGraphToGraph :: CmmAGraph -> FCode CmmGraph

getCodeR :: FCode a -> FCode (a, CmmAGraph)

getCode :: FCode a -> FCode CmmAGraph

getHeapUsage :: (VirtualHpOffset -> FCode a) -> FCode a

mkCmmIfThenElse :: CmmExpr -> CmmAGraph -> CmmAGraph -> FCode CmmAGraph

mkCmmIfThen :: CmmExpr -> CmmAGraph -> FCode CmmAGraph

mkCmmIfGoto :: CmmExpr -> BlockId -> FCode CmmAGraph

mkCall :: CmmExpr -> (Convention, Convention) -> [CmmFormal] -> [CmmActual] -> UpdFrameOffset -> [CmmActual] -> FCode CmmAGraph

mkCmmCall :: CmmExpr -> [CmmFormal] -> [CmmActual] -> UpdFrameOffset -> FCode CmmAGraph

forkClosureBody :: FCode () -> FCode ()

forkLneBody :: FCode a -> FCode a

forkAlts :: [FCode a] -> FCode [a]

codeOnly :: FCode () -> FCode ()

type ConTagZ = Int

data Sequel

Constructors

Return Bool |
AssignTo [LocalReg] Bool |

data ReturnKind

Constructors

AssignedDirectly |
ReturnedTo BlockId ByteOff |

withSequel :: Sequel -> FCode a -> FCode a

getSequel :: FCode Sequel

setTickyCtrLabel :: CLabel -> FCode a -> FCode a

getTickyCtrLabel :: FCode CLabel

withUpdFrameOff :: UpdFrameOffset -> FCode a -> FCode a

getUpdFrameOff :: FCode UpdFrameOffset

initUpdFrameOff :: DynFlags -> UpdFrameOffset

data HeapUsage

Constructors

HeapUsage |

Fields

virtHp :: VirtualHpOffset
realHp :: VirtualHpOffset

type VirtualHpOffset = WordOff

initHpUsage :: HeapUsage

getHpUsage :: FCode HeapUsage

setHpUsage :: HeapUsage -> FCode ()

heapHWM :: HeapUsage -> VirtualHpOffset

setVirtHp :: VirtualHpOffset -> FCode ()

getVirtHp :: FCode VirtualHpOffset

setRealHp :: VirtualHpOffset -> FCode ()

getModuleName :: FCode Module

getState :: FCode CgState

setState :: CgState -> FCode ()

getSelfLoop :: FCode (Maybe SelfLoopInfo)

withSelfLoop :: SelfLoopInfo -> FCode a -> FCode a

getInfoDown :: FCode CgInfoDownwards

getDynFlags :: HasDynFlags m => m DynFlags

getThisPackage :: FCode PackageId

data CgIdInfo

Constructors

CgIdInfo |

Fields

cg_id :: Id
cg_lf :: LambdaFormInfo
cg_loc :: CgLoc

Instances

Outputable CgIdInfo |

getBinds :: FCode CgBindings

setBinds :: CgBindings -> FCode ()

data CgInfoDownwards

Constructors

MkCgInfoDown |

Fields

cgd_dflags :: DynFlags
cgd_mod :: Module
cgd_updfr_off :: UpdFrameOffset
cgd_ticky :: CLabel
cgd_sequel :: Sequel
cgd_self_loop :: Maybe SelfLoopInfo

data CgState

Constructors

MkCgState |

Fields

cgs_stmts :: CmmAGraph
cgs_tops :: OrdList CmmDecl
cgs_binds :: CgBindings
cgs_hp_usg :: HeapUsage
cgs_uniqs :: UniqSupply