ghc-7.0.3: The GHC API

CgMonad

# Documentation

type Code = FCode ()Source

data FCode a Source

Instances

Monad FCode |

initC :: DynFlags -> Module -> FCode a -> IO aSource

thenC :: Code -> FCode a -> FCode aSource

thenFC :: FCode a -> (a -> FCode c) -> FCode cSource

listCs :: [Code] -> Code Source

listFCs :: [FCode a] -> FCode [a]Source

mapCs :: (a -> Code) -> [a] -> Code Source

mapFCs :: (a -> FCode b) -> [a] -> FCode [b]Source

returnFC :: a -> FCode aSource

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

fixC_ :: (a -> FCode a) -> FCode ()Source

checkedAbsC :: CmmStmt -> Code Source

stmtC :: CmmStmt -> Code Source

stmtsC :: [CmmStmt] -> Code Source

labelC :: BlockId -> Code Source

emitStmts :: CmmStmts -> Code Source

nopC :: Code Source

whenC :: Bool -> Code -> Code Source

newLabelC :: FCode BlockId Source

newUnique :: FCode Unique Source

newUniqSupply :: FCode UniqSupply Source

type CgStmts = OrdList CgStmtSource

emitCgStmts :: CgStmts -> Code Source

forkCgStmts :: CgStmts -> FCode BlockId Source

cgStmtsToBlocks :: CgStmts -> FCode [CmmBasicBlock]Source

getCgStmts' :: FCode a -> FCode (a, CgStmts)Source

getCgStmts :: FCode a -> FCode CgStmts Source

noCgStmts :: CgStmts Source

oneCgStmt :: CmmStmt -> CgStmts Source

consCgStmt :: CmmStmt -> CgStmts -> CgStmts Source

getCmm :: Code -> FCode Cmm Source

emitData :: Section -> [CmmStatic] -> Code Source

emitProc :: CmmInfo -> CLabel -> CmmFormals -> [CmmBasicBlock] -> Code Source

emitSimpleProc :: CLabel -> Code -> Code Source

forkLabelledCode :: Code -> FCode BlockId Source

forkClosureBody :: Code -> Code Source

forkStatics :: FCode a -> FCode aSource

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

forkEval :: EndOfBlockInfo -> Code -> FCode Sequel -> FCode EndOfBlockInfo Source

forkEvalHelp :: EndOfBlockInfo -> Code -> FCode a -> FCode (VirtualSpOffset, a)Source

forkProc :: Code -> FCode CgStmts Source

codeOnly :: Code -> Code Source

type SemiTaggingStuff = Maybe ([(ConTagZ, CmmLit)], CmmLit)Source

type ConTagZ = Int Source

data EndOfBlockInfo Source

Constructors

EndOfBlockInfo VirtualSpOffset Sequel |

setEndOfBlockInfo :: EndOfBlockInfo -> Code -> Code Source

getEndOfBlockInfo :: FCode EndOfBlockInfo Source

setSRT :: SRT -> FCode a -> FCode aSource

getSRT :: FCode SRT Source

setSRTLabel :: CLabel -> FCode a -> FCode aSource

getSRTLabel :: FCode CLabel Source

setTickyCtrLabel :: CLabel -> Code -> Code Source

getTickyCtrLabel :: FCode CLabel Source

data StackUsage Source

Constructors

StackUsage |

Fields

virtSp :: VirtualSpOffset
frameSp :: VirtualSpOffset
freeStk :: [VirtualSpOffset]
realSp :: VirtualSpOffset
hwSp :: VirtualSpOffset

data HeapUsage Source

Constructors

HeapUsage |

Fields

virtHp :: VirtualHpOffset
realHp :: VirtualHpOffset

type VirtualSpOffset = WordOff Source

type VirtualHpOffset = WordOff Source

initStkUsage :: StackUsage Source

initHpUsage :: HeapUsage Source

getHpUsage :: FCode HeapUsage Source

setHpUsage :: HeapUsage -> Code Source

heapHWM :: HeapUsage -> VirtualHpOffset Source

getModuleName :: FCode Module Source

data Sequel Source

Constructors

OnStack |
CaseAlts CLabel SemiTaggingStuff Id |

getState :: FCode CgState Source

setState :: CgState -> FCode ()Source

getInfoDown :: FCode CgInfoDownwards Source

getDynFlags :: FCode DynFlags Source

getThisPackage :: FCode PackageId Source

getStkUsage :: FCode StackUsage Source

setStkUsage :: StackUsage -> Code Source

getBinds :: FCode CgBindings Source

setBinds :: CgBindings -> FCode ()Source

getStaticBinds :: FCode CgBindings Source

data CgInfoDownwards Source

Constructors

MkCgInfoDown |

Fields

cgd_dflags :: DynFlags
cgd_mod :: Module
cgd_statics :: CgBindings
cgd_srt_lbl :: CLabel
cgd_srt :: SRT
cgd_ticky :: CLabel
cgd_eob :: EndOfBlockInfo

data CgState Source

Constructors

MkCgState |

Fields

cgs_stmts :: OrdList CgStmt
cgs_tops :: OrdList CmmTop
cgs_binds :: CgBindings
cgs_stk_usg :: StackUsage
cgs_hp_usg :: HeapUsage
cgs_uniqs :: UniqSupply