ghc-7.4.2: The GHC API

Safe Haskell | None

CgMonad

# Documentation

type Code = FCode ()

data FCode a

Instances

Monad FCode |

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

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

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

listCs :: [Code] -> Code

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

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

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

returnFC :: a -> FCode a

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

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

checkedAbsC :: CmmStmt -> Code

stmtC :: CmmStmt -> Code

stmtsC :: [CmmStmt] -> Code

labelC :: BlockId -> Code

emitStmts :: CmmStmts -> Code

nopC :: Code

whenC :: Bool -> Code -> Code

newLabelC :: FCode BlockId

newUnique :: FCode Unique

newUniqSupply :: FCode UniqSupply

type CgStmts = OrdList CgStmt

emitCgStmts :: CgStmts -> Code

forkCgStmts :: CgStmts -> FCode BlockId

cgStmtsToBlocks :: CgStmts -> FCode [CmmBasicBlock]

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

getCgStmts :: FCode a -> FCode CgStmts

noCgStmts :: CgStmts

oneCgStmt :: CmmStmt -> CgStmts

consCgStmt :: CmmStmt -> CgStmts -> CgStmts

getCmm :: Code -> FCode CmmGroup

emitDecl :: CmmDecl -> Code

emitProc :: CmmInfo -> CLabel -> [CmmFormal] -> [CmmBasicBlock] -> Code

emitSimpleProc :: CLabel -> Code -> Code

forkLabelledCode :: Code -> FCode BlockId

forkClosureBody :: Code -> Code

forkStatics :: FCode a -> FCode a

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

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

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

forkProc :: Code -> FCode CgStmts

codeOnly :: Code -> Code

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

type ConTagZ = Int

data EndOfBlockInfo

Constructors

EndOfBlockInfo VirtualSpOffset Sequel |

setEndOfBlockInfo :: EndOfBlockInfo -> Code -> Code

getEndOfBlockInfo :: FCode EndOfBlockInfo

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

getSRT :: FCode SRT

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

getSRTLabel :: FCode CLabel

setTickyCtrLabel :: CLabel -> Code -> Code

getTickyCtrLabel :: FCode CLabel

data StackUsage

Constructors

StackUsage |

Fields

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

data HeapUsage

Constructors

HeapUsage |

Fields

virtHp :: VirtualHpOffset
realHp :: VirtualHpOffset

type VirtualSpOffset = WordOff

type VirtualHpOffset = WordOff

initStkUsage :: StackUsage

initHpUsage :: HeapUsage

getHpUsage :: FCode HeapUsage

setHpUsage :: HeapUsage -> Code

heapHWM :: HeapUsage -> VirtualHpOffset

getModuleName :: FCode Module

data Sequel

Constructors

OnStack |
CaseAlts CLabel SemiTaggingStuff Id |

getState :: FCode CgState

setState :: CgState -> FCode ()

getInfoDown :: FCode CgInfoDownwards

getDynFlags :: FCode DynFlags

getThisPackage :: FCode PackageId

getStkUsage :: FCode StackUsage

setStkUsage :: StackUsage -> Code

getBinds :: FCode CgBindings

setBinds :: CgBindings -> FCode ()

getStaticBinds :: FCode CgBindings

data CgInfoDownwards

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

Constructors

MkCgState |

Fields

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