ghc-7.4.2: The GHC API

Safe Haskell | None

MkGraph

Synopsis

- type CmmAGraph = UniqSM CmmGraphOC
- emptyAGraph :: CmmAGraph
- (<*>) :: CmmAGraph -> CmmAGraph -> CmmAGraph
- catAGraphs :: [CmmAGraph] -> CmmAGraph
- outOfLine :: CmmAGraph -> CmmAGraph
- mkLabel :: BlockId -> CmmAGraph
- mkMiddle :: CmmNode O O -> CmmAGraph
- mkLast :: CmmNode O C -> CmmAGraph
- withFreshLabel :: String -> (BlockId -> CmmAGraph) -> CmmAGraph
- withUnique :: (Unique -> CmmAGraph) -> CmmAGraph
- lgraphOfAGraph :: CmmAGraph -> UniqSM CmmGraph
- labelAGraph :: BlockId -> CmmAGraph -> UniqSM CmmGraph
- stackStubExpr :: Width -> CmmExpr
- mkNop :: CmmAGraph
- mkAssign :: CmmReg -> CmmExpr -> CmmAGraph
- mkStore :: CmmExpr -> CmmExpr -> CmmAGraph
- mkCall :: CmmExpr -> (Convention, Convention) -> [CmmFormal] -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkCmmCall :: CmmExpr -> [CmmFormal] -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkSafeCall :: ForeignTarget -> [CmmFormal] -> [CmmActual] -> UpdFrameOffset -> Bool -> CmmAGraph
- mkUnsafeCall :: ForeignTarget -> [CmmFormal] -> [CmmActual] -> CmmAGraph
- mkFinalCall :: CmmExpr -> CCallConv -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkJump :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkDirectJump :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkForeignJump :: Convention -> CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkJumpGC :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkCbranch :: CmmExpr -> BlockId -> BlockId -> CmmAGraph
- mkSwitch :: CmmExpr -> [Maybe BlockId] -> CmmAGraph
- mkReturn :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkReturnSimple :: [CmmActual] -> UpdFrameOffset -> CmmAGraph
- mkComment :: FastString -> CmmAGraph
- mkCallEntry :: Convention -> [CmmFormal] -> (Int, CmmAGraph)
- mkBranch :: BlockId -> CmmAGraph
- mkCmmIfThenElse :: CmmExpr -> CmmAGraph -> CmmAGraph -> CmmAGraph
- mkCmmIfThen :: CmmExpr -> CmmAGraph -> CmmAGraph
- mkCmmWhileDo :: CmmExpr -> CmmAGraph -> CmmAGraph
- copyInOflow :: Convention -> Area -> [CmmFormal] -> (Int, CmmAGraph)
- copyInSlot :: Convention -> [CmmFormal] -> [CmmNode O O]
- copyOutOflow :: Convention -> Transfer -> Area -> [CmmActual] -> UpdFrameOffset -> (Int, CmmAGraph)
- copyOutSlot :: Convention -> [LocalReg] -> [CmmNode O O]

# Documentation

type CmmAGraph = UniqSM CmmGraphOC

emptyAGraph :: CmmAGraph

(<*>) :: CmmAGraph -> CmmAGraph -> CmmAGraph

catAGraphs :: [CmmAGraph] -> CmmAGraph

outOfLine :: CmmAGraph -> CmmAGraph

The argument is an CmmAGraph that must have an empty entry sequence and be closed at the end. The result is a new CmmAGraph that is open at the end and goes directly from entry to exit, with the original graph sitting to the side out-of-line.

Example: mkMiddle (x = 3) * outOfLine (mkLabel L * ...stuff...) * mkMiddle (y = x) Control will flow directly from x=3 to y=x; the block starting with L is on the side.

N.B. algebraically forall g g' : g * outOfLine g' == outOfLine g' * g

mkLabel :: BlockId -> CmmAGraph

mkMiddle :: CmmNode O O -> CmmAGraph

mkLast :: CmmNode O C -> CmmAGraph

withFreshLabel :: String -> (BlockId -> CmmAGraph) -> CmmAGraph

withUnique :: (Unique -> CmmAGraph) -> CmmAGraph

lgraphOfAGraph

Arguments

:: CmmAGraph |
-> UniqSM CmmGraph | allocate a fresh label for the entry point

labelAGraph

Arguments

:: BlockId |
-> CmmAGraph |
-> UniqSM CmmGraph | use the given BlockId as the label of the entry point

stackStubExpr :: Width -> CmmExpr

mkNop :: CmmAGraph

mkAssign :: CmmReg -> CmmExpr -> CmmAGraph

mkStore :: CmmExpr -> CmmExpr -> CmmAGraph

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

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

mkSafeCall :: ForeignTarget -> [CmmFormal] -> [CmmActual] -> UpdFrameOffset -> Bool -> CmmAGraph

mkUnsafeCall :: ForeignTarget -> [CmmFormal] -> [CmmActual] -> CmmAGraph

mkFinalCall :: CmmExpr -> CCallConv -> [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkJump :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkDirectJump :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkForeignJump :: Convention -> CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkJumpGC :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkCbranch :: CmmExpr -> BlockId -> BlockId -> CmmAGraph

mkSwitch :: CmmExpr -> [Maybe BlockId] -> CmmAGraph

mkReturn :: CmmExpr -> [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkReturnSimple :: [CmmActual] -> UpdFrameOffset -> CmmAGraph

mkComment :: FastString -> CmmAGraph

mkCallEntry :: Convention -> [CmmFormal] -> (Int, CmmAGraph)

mkBranch :: BlockId -> CmmAGraph

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

mkCmmIfThen :: CmmExpr -> CmmAGraph -> CmmAGraph

mkCmmWhileDo :: CmmExpr -> CmmAGraph -> CmmAGraph

copyInOflow :: Convention -> Area -> [CmmFormal] -> (Int, CmmAGraph)

copyInSlot :: Convention -> [CmmFormal] -> [CmmNode O O]

copyOutOflow :: Convention -> Transfer -> Area -> [CmmActual] -> UpdFrameOffset -> (Int, CmmAGraph)

copyOutSlot :: Convention -> [LocalReg] -> [CmmNode O O]