ghc-7.4.2: The GHC API

Safe Haskell | None

OldCmm

Synopsis

- type CmmGroup = GenCmmGroup CmmStatics CmmInfo (ListGraph CmmStmt)
- type GenCmmGroup d h g = [GenCmmDecl d h g]
- type RawCmmGroup = GenCmmGroup CmmStatics (Maybe CmmStatics) (ListGraph CmmStmt)
- type CmmDecl = GenCmmDecl CmmStatics CmmInfo (ListGraph CmmStmt)
- type RawCmmDecl = GenCmmDecl CmmStatics (Maybe CmmStatics) (ListGraph CmmStmt)
- newtype ListGraph i = ListGraph [GenBasicBlock i]
- data CmmInfo = CmmInfo (Maybe BlockId) (Maybe UpdateFrame) CmmInfoTable
- data UpdateFrame = UpdateFrame CmmExpr [CmmExpr]
- data CmmInfoTable
  - = CmmInfoTable {
    - cit_lbl :: CLabel
    - cit_rep :: SMRep
    - cit_prof :: ProfilingInfo
    - cit_srt :: C_SRT
    }
  - | CmmNonInfoTable
- data ClosureTypeInfo
  - = Constr ConstrTag ConstrDescription
  - | Fun FunArity ArgDescr
  - | Thunk
  - | ThunkSelector SelectorOffset
  - | BlackHole
- data CmmStatic
  - = CmmStaticLit CmmLit
  - | CmmUninitialised Int
  - | CmmString [Word8]
- data CmmStatics = Statics CLabel [CmmStatic]
- type CmmFormal = LocalReg
- type CmmActual = CmmExpr
- cmmMapGraph :: (g -> g') -> GenCmmGroup d h g -> GenCmmGroup d h g'
- cmmTopMapGraph :: (g -> g') -> GenCmmDecl d h g -> GenCmmDecl d h g'
- data GenBasicBlock i = BasicBlock BlockId [i]
- type CmmBasicBlock = GenBasicBlock CmmStmt
- blockId :: GenBasicBlock i -> BlockId
- blockStmts :: GenBasicBlock i -> [i]
- mapBlockStmts :: (i -> i') -> GenBasicBlock i -> GenBasicBlock i'
- data CmmStmt
  - = CmmNop
  - | CmmComment FastString
  - | CmmAssign CmmReg CmmExpr
  - | CmmStore CmmExpr CmmExpr
  - | CmmCall CmmCallTarget [HintedCmmFormal] [HintedCmmActual] CmmReturnInfo
  - | CmmBranch BlockId
  - | CmmCondBranch CmmExpr BlockId
  - | CmmSwitch CmmExpr [Maybe BlockId]
  - | CmmJump CmmExpr [HintedCmmActual]
  - | CmmReturn [HintedCmmActual]
- data CmmReturnInfo
  - = CmmMayReturn
  - | CmmNeverReturns
- data CmmHinted a = CmmHinted {
  - hintlessCmm :: a
  - cmmHint :: ForeignHint
  }
- type HintedCmmFormal = CmmHinted CmmFormal
- type HintedCmmActual = CmmHinted CmmActual
- data CmmSafety
  - = CmmUnsafe
  - | CmmSafe C_SRT
  - | CmmInterruptible
- data CmmCallTarget
  - = CmmCallee CmmExpr CCallConv
  - | CmmPrim CallishMachOp
- data GenCmmDecl d h g
  - = CmmProc h CLabel g
  - | CmmData Section d
- data ForeignHint
  - = NoHint
  - | AddrHint
  - | SignedHint
- module CmmExpr
- data Section
  - = Text
  - | Data
  - | ReadOnlyData
  - | RelocatableReadOnlyData
  - | UninitialisedData
  - | ReadOnlyData16
  - | OtherSection String
- data ProfilingInfo
  - = NoProfilingInfo
  - | ProfilingInfo [Word8] [Word8]
- data C_SRT
  - = NoC_SRT
  - | C_SRT !CLabel !WordOff !StgHalfWord

# Documentation

type CmmGroup = GenCmmGroup CmmStatics CmmInfo (ListGraph CmmStmt)

Cmm with the info table as a data type

type GenCmmGroup d h g = [GenCmmDecl d h g]

type RawCmmGroup = GenCmmGroup CmmStatics (Maybe CmmStatics) (ListGraph CmmStmt)

Cmm with the info tables converted to a list of `CmmStatic` along with the info table label. If we are building without tables-next-to-code there will be no statics

INVARIANT: if there is an info table, it has at least one CmmStatic

type CmmDecl = GenCmmDecl CmmStatics CmmInfo (ListGraph CmmStmt)

type RawCmmDecl = GenCmmDecl CmmStatics (Maybe CmmStatics) (ListGraph CmmStmt)

newtype ListGraph i

A control-flow graph represented as a list of extended basic blocks.

Constructors

ListGraph [GenBasicBlock i] | Code, may be empty. The first block is the entry point. The order is otherwise initially unimportant, but at some point the code gen will fix the order.

Instances

PlatformOutputable instr => PlatformOutputable (ListGraph instr) |

data CmmInfo

Constructors

CmmInfo (Maybe BlockId) (Maybe UpdateFrame) CmmInfoTable |

Instances

PlatformOutputable CmmInfo |

data UpdateFrame

A frame that is to be pushed before entry to the function. Used to handle `update` frames.

Constructors

UpdateFrame CmmExpr [CmmExpr] |

data CmmInfoTable

Info table as a haskell data type

Constructors

CmmInfoTable |

Fields

cit_lbl :: CLabel
cit_rep :: SMRep
cit_prof :: ProfilingInfo
cit_srt :: C_SRT

CmmNonInfoTable |

Instances

PlatformOutputable CmmInfoTable |

data ClosureTypeInfo

Constructors

Constr ConstrTag ConstrDescription |
Fun FunArity ArgDescr |
Thunk |
ThunkSelector SelectorOffset |
BlackHole |

Instances

Outputable ClosureTypeInfo |

data CmmStatic

Constructors

CmmStaticLit CmmLit |
CmmUninitialised Int |
CmmString [Word8] |

Instances

PlatformOutputable CmmStatic |

data CmmStatics

Constructors

Statics CLabel [CmmStatic] |

Instances

PlatformOutputable CmmStatics |

type CmmFormal = LocalReg

type CmmActual = CmmExpr

cmmMapGraph :: (g -> g') -> GenCmmGroup d h g -> GenCmmGroup d h g'

cmmTopMapGraph :: (g -> g') -> GenCmmDecl d h g -> GenCmmDecl d h g'

data GenBasicBlock i

Constructors

BasicBlock BlockId [i] |

Instances

PlatformOutputable instr => PlatformOutputable (GenBasicBlock instr) |
UserOfLocalRegs i => UserOfLocalRegs (GenBasicBlock i) |

type CmmBasicBlock = GenBasicBlock CmmStmt

blockId :: GenBasicBlock i -> BlockId

blockStmts :: GenBasicBlock i -> [i]

mapBlockStmts :: (i -> i') -> GenBasicBlock i -> GenBasicBlock i'

data CmmStmt

Constructors

CmmNop |
CmmComment FastString |
CmmAssign CmmReg CmmExpr |
CmmStore CmmExpr CmmExpr |
CmmCall CmmCallTarget [HintedCmmFormal] [HintedCmmActual] CmmReturnInfo |
CmmBranch BlockId |
CmmCondBranch CmmExpr BlockId |
CmmSwitch CmmExpr [Maybe BlockId] |
CmmJump CmmExpr [HintedCmmActual] |
CmmReturn [HintedCmmActual] |

Instances

PlatformOutputable CmmStmt |
UserOfLocalRegs CmmStmt | enable us to fold used registers over '[CmmActual]' and '[CmmFormal]'

data CmmReturnInfo

Constructors

CmmMayReturn |
CmmNeverReturns |

Instances

Eq CmmReturnInfo |

data CmmHinted a

Constructors

CmmHinted |

Fields

hintlessCmm :: a
cmmHint :: ForeignHint

Instances

Eq a => Eq (CmmHinted a) |
PlatformOutputable a => PlatformOutputable (CmmHinted a) |
Outputable a => Outputable (CmmHinted a) |
UserOfSlots a => UserOfSlots (CmmHinted a) |
DefinerOfLocalRegs a => DefinerOfLocalRegs (CmmHinted a) |
UserOfLocalRegs a => UserOfLocalRegs (CmmHinted a) |

type HintedCmmFormal = CmmHinted CmmFormal

type HintedCmmActual = CmmHinted CmmActual

data CmmSafety

Constructors

CmmUnsafe |
CmmSafe C_SRT |
CmmInterruptible |

Instances

PlatformOutputable CmmSafety |

data CmmCallTarget

Constructors

CmmCallee CmmExpr CCallConv |
CmmPrim CallishMachOp |

Instances

Eq CmmCallTarget |
UserOfSlots CmmCallTarget |
UserOfLocalRegs CmmCallTarget |

data GenCmmDecl d h g

A top-level chunk, abstracted over the type of the contents of the basic blocks (Cmm or instructions are the likely instantiations).

Constructors

CmmProc h CLabel g |
CmmData Section d |

Instances

(PlatformOutputable d, PlatformOutputable info, PlatformOutputable i) => PlatformOutputable (GenCmmDecl d info i) |

data ForeignHint

Constructors

NoHint |
AddrHint |
SignedHint |

Instances

Eq ForeignHint |
PlatformOutputable ForeignHint |
Outputable ForeignHint |

module CmmExpr

data Section

Constructors

Text |
Data |
ReadOnlyData |
RelocatableReadOnlyData |
UninitialisedData |
ReadOnlyData16 |
OtherSection String |

data ProfilingInfo

Constructors

NoProfilingInfo |
ProfilingInfo [Word8] [Word8] |

data C_SRT

Constructors

NoC_SRT |
C_SRT !CLabel !WordOff !StgHalfWord |

Instances

Eq C_SRT |
PlatformOutputable C_SRT |