| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Language.QBE.Analysis.CFG
Synopsis
- type Label = Key
- data CFG
- build :: FuncDef -> CFG
- identToLabel :: CFG -> BlockIdent -> Label
- labelToIdent :: CFG -> Label -> BlockIdent
- labelToBlock :: CFG -> Label -> Block
- lookupSuccs :: CFG -> Label -> [Label]
- asGraph :: CFG -> Graph
- nodes :: CFG -> [Label]
- edges :: CFG -> [(Label, Label)]
- bounds :: CFG -> Bounds
- asDomGraph :: CFG -> Graph
- startNode :: CFG -> Label
Control Flow Graph
identToLabel :: CFG -> BlockIdent -> Label Source #
Convert a BlockIdent to a CFG node Label.
This function is partial, on an invalid Label, an error is thrown.
labelToIdent :: CFG -> Label -> BlockIdent Source #
Convert a CFG node Label to a BlockIdent.
This function is partial, on an invalid Label, an error is thrown.
lookupSuccs :: CFG -> Label -> [Label] Source #
Mapping of Label to its successors in the CFG, represented as an
ordered list of zero, one, or two elements. A list with two elements
represents a conditional jump where the left child is the is the true
branch and the right child is the false branch. A list wih a single
element signifies an unconditional jump. If the given node does not
have any successors an empty list is returned.
This function is partial, on an invalid Label, an error is thrown.
Graph Representation
Dominator Analysis
asDomGraph :: CFG -> Graph Source #