GHC.Cmm.Dataflow.Block
Documentation
data Extensibility Source #
Used at the type level to indicate "open" vs "closed" structure.
Constructors
Open | An "open" structure with a unique, unnamed control-flow edge flowing in or out. "Fallthrough" and concatenation are permitted at an open point. |
Closed | A "closed" structure which supports control transfer only through the use of named labels---no "fallthrough" is permitted. The number of control-flow edges is unconstrained. |
type family IndexedCO (ex :: Extensibility) (a :: k) (b :: k) :: k Source #
Either type indexed by closed/open using type families
data Block n e x where Source #
A sequence of nodes. May be any of four shapes (OO, OC, CO, CC). Open at the entry means single entry, mutatis mutandis for exit. A closedclosed block is a basic/ block and can't be extended further. Clients should avoid manipulating blocks and should stick to either nodes or graphs.
Constructors
BlockCO :: n C O -> Block n O O -> Block n C O | |
BlockCC :: n C O -> Block n O O -> n O C -> Block n C C | |
BlockOC :: Block n O O -> n O C -> Block n O C | |
BNil :: Block n O O | |
BMiddle :: n O O -> Block n O O | |
BCat :: Block n O O -> Block n O O -> Block n O O | |
BSnoc :: Block n O O -> n O O -> Block n O O | |
BCons :: n O O -> Block n O O -> Block n O O |
Instances
OutputableP Platform (Block CmmNode C C) Source # | |
OutputableP Platform (Block CmmNode C O) Source # | |
OutputableP Platform (Block CmmNode O C) Source # | |
OutputableP Platform (Block CmmNode O O) Source # | |
OutputableP Platform (Graph CmmNode e x) Source # | |
NonLocal n => NonLocal (Block n) Source # | |
Defined in GHC.Cmm.Dataflow.Graph Methods entryLabel :: forall (x :: Extensibility). Block n C x -> Label Source # successors :: forall (e :: Extensibility). Block n e C -> [Label] Source # |
blockSplit :: Block n C C -> (n C O, Block n O O, n O C) Source #
Split a closed block into its entry node, open middle block, and exit node.
foldBlockNodesB :: forall n a. (forall e x. n e x -> a -> a) -> forall e x. Block n e x -> IndexedCO x a a -> IndexedCO e a a Source #
foldBlockNodesB3 :: forall n a b c. (n C O -> b -> c, n O O -> b -> b, n O C -> a -> b) -> forall e x. Block n e x -> IndexedCO x a b -> IndexedCO e c b Source #
foldBlockNodesF :: forall n a. (forall e x. n e x -> a -> a) -> forall e x. Block n e x -> IndexedCO e a a -> IndexedCO x a a Source #
isEmptyBlock :: Block n e x -> Bool Source #
mapBlock :: (forall e x. n e x -> n' e x) -> Block n e x -> Block n' e x Source #
map a function over the nodes of a Block