Cmm

ghc-8.8.1: The GHC API

Safe Haskell | None
Language | Haskell2010

Cmm

Contents

- Cmm top-level datatypes
  - Blocks containing lists
- Info Tables
- Statements, expressions and types

Synopsis

- type CmmProgram = [CmmGroup]
- type CmmGroup = GenCmmGroup CmmStatics CmmTopInfo CmmGraph
- type GenCmmGroup d h g = [GenCmmDecl d h g]
- type CmmDecl = GenCmmDecl CmmStatics CmmTopInfo CmmGraph
- data GenCmmDecl d h g
  - = CmmProc h CLabel [GlobalReg] g
  - | CmmData Section d
- type CmmGraph = GenCmmGraph CmmNode
- data GenCmmGraph n = CmmGraph {
  - g_entry :: BlockId
  - g_graph :: Graph n C C
  }
- type CmmBlock = Block CmmNode C C
- type RawCmmDecl = GenCmmDecl CmmStatics (LabelMap CmmStatics) CmmGraph
- type RawCmmGroup = GenCmmGroup CmmStatics (LabelMap CmmStatics) CmmGraph
- data Section = Section SectionType CLabel
- data SectionType
  - = Text
  - | Data
  - | ReadOnlyData
  - | RelocatableReadOnlyData
  - | UninitialisedData
  - | ReadOnlyData16
  - | CString
  - | OtherSection String
- data CmmStatics = Statics CLabel [CmmStatic]
- data CmmStatic
  - = CmmStaticLit CmmLit
  - | CmmUninitialised Int
  - | CmmString [Word8]
- isSecConstant :: Section -> Bool
- data GenBasicBlock i = BasicBlock BlockId [i]
- blockId :: GenBasicBlock i -> BlockId
- newtype ListGraph i = ListGraph [GenBasicBlock i]
- pprBBlock :: Outputable stmt => GenBasicBlock stmt -> SDoc
- data CmmTopInfo = TopInfo {
  - info_tbls :: LabelMap CmmInfoTable
  - stack_info :: CmmStackInfo
  }
- data CmmStackInfo = StackInfo {
  - arg_space :: ByteOff
  - updfr_space :: Maybe ByteOff
  - do_layout :: Bool
  }
- data CmmInfoTable = CmmInfoTable {
  - cit_lbl :: CLabel
  - cit_rep :: SMRep
  - cit_prof :: ProfilingInfo
  - cit_srt :: Maybe CLabel
  - cit_clo :: Maybe (Id, CostCentreStack)
  }
- topInfoTable :: GenCmmDecl a CmmTopInfo (GenCmmGraph n) -> Maybe CmmInfoTable
- data ClosureTypeInfo
  - = Constr ConTagZ ConstrDescription
  - | Fun FunArity ArgDescr
  - | Thunk
  - | ThunkSelector SelectorOffset
  - | BlackHole
  - | IndStatic
- data ProfilingInfo
  - = NoProfilingInfo
  - | ProfilingInfo [Word8] [Word8]
- type ConstrDescription = [Word8]
- module CmmNode
- module CmmExpr

# Cmm top-level datatypes

type CmmProgram = [CmmGroup] Source #

type CmmGroup = GenCmmGroup CmmStatics CmmTopInfo CmmGraph Source #

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

type CmmDecl = GenCmmDecl CmmStatics CmmTopInfo CmmGraph Source #

data GenCmmDecl d h g Source #

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 [GlobalReg] g |
CmmData Section d |

#### Instances

Instances details

(Outputable d, Outputable info, Outputable i) => Outputable (GenCmmDecl d info i) # |
Instance details Defined in PprCmmDecl Methods ppr :: GenCmmDecl d info i -> SDoc Source # pprPrec :: Rational -> GenCmmDecl d info i -> SDoc Source #

type CmmGraph = GenCmmGraph CmmNode Source #

data GenCmmGraph n Source #

Constructors

CmmGraph |
Fields g_entry :: BlockId g_graph :: Graph n C C

#### Instances

Instances details

Outputable CmmGraph # |
Instance details Defined in PprCmm Methods ppr :: CmmGraph -> SDoc Source # pprPrec :: Rational -> CmmGraph -> SDoc Source #

type CmmBlock = Block CmmNode C C Source #

type RawCmmDecl = GenCmmDecl CmmStatics (LabelMap CmmStatics) CmmGraph Source #

type RawCmmGroup = GenCmmGroup CmmStatics (LabelMap CmmStatics) CmmGraph Source #

data Section Source #

Constructors

Section SectionType CLabel |

data SectionType Source #

Constructors

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

#### Instances

Instances details

Show SectionType # |
Instance details Defined in Cmm Methods showsPrec :: Int -> SectionType -> ShowS Source # show :: SectionType -> String Source # showList :: [SectionType] -> ShowS Source #

data CmmStatics Source #

Constructors

Statics CLabel [CmmStatic] |

#### Instances

Instances details

Outputable CmmStatics # |
Instance details Defined in PprCmmDecl Methods ppr :: CmmStatics -> SDoc Source # pprPrec :: Rational -> CmmStatics -> SDoc Source #

data CmmStatic Source #

Constructors

CmmStaticLit CmmLit |
CmmUninitialised Int |
CmmString [Word8] |

#### Instances

Instances details

Outputable CmmStatic # |
Instance details Defined in PprCmmDecl Methods ppr :: CmmStatic -> SDoc Source # pprPrec :: Rational -> CmmStatic -> SDoc Source #

isSecConstant :: Section -> Bool Source #

Should a data in this section be considered constant

## Blocks containing lists

data GenBasicBlock i Source #

Constructors

BasicBlock BlockId [i] |

#### Instances

Instances details

Outputable instr => Outputable (GenBasicBlock instr) # |
Instance details Defined in Cmm Methods ppr :: GenBasicBlock instr -> SDoc Source # pprPrec :: Rational -> GenBasicBlock instr -> SDoc Source #

blockId :: GenBasicBlock i -> BlockId Source #

The branch block id is that of the first block in the branch, which is that branch's entry point

newtype ListGraph i Source #

Constructors

ListGraph [GenBasicBlock i] |

#### Instances

Instances details

Outputable instr => Outputable (ListGraph instr) # |
Instance details Defined in Cmm Methods ppr :: ListGraph instr -> SDoc Source # pprPrec :: Rational -> ListGraph instr -> SDoc Source #

pprBBlock :: Outputable stmt => GenBasicBlock stmt -> SDoc Source #

# Info Tables

data CmmTopInfo Source #

Constructors

TopInfo |
Fields info_tbls :: LabelMap CmmInfoTable stack_info :: CmmStackInfo

#### Instances

Instances details

Outputable CmmTopInfo # |
Instance details Defined in PprCmm Methods ppr :: CmmTopInfo -> SDoc Source # pprPrec :: Rational -> CmmTopInfo -> SDoc Source #

data CmmStackInfo Source #

Constructors

StackInfo |
Fields arg_space :: ByteOff updfr_space :: Maybe ByteOff do_layout :: Bool

#### Instances

Instances details

Outputable CmmStackInfo # |
Instance details Defined in PprCmm Methods ppr :: CmmStackInfo -> SDoc Source # pprPrec :: Rational -> CmmStackInfo -> SDoc Source #

data CmmInfoTable Source #

Info table as a haskell data type

Constructors

CmmInfoTable |
Fields cit_lbl :: CLabel cit_rep :: SMRep cit_prof :: ProfilingInfo cit_srt :: Maybe CLabel cit_clo :: Maybe (Id, CostCentreStack)

#### Instances

Instances details

Outputable CmmInfoTable # |
Instance details Defined in PprCmmDecl Methods ppr :: CmmInfoTable -> SDoc Source # pprPrec :: Rational -> CmmInfoTable -> SDoc Source #

topInfoTable :: GenCmmDecl a CmmTopInfo (GenCmmGraph n) -> Maybe CmmInfoTable Source #

data ClosureTypeInfo Source #

Constructors

Constr ConTagZ ConstrDescription |
Fun FunArity ArgDescr |
Thunk |
ThunkSelector SelectorOffset |
BlackHole |
IndStatic |

#### Instances

Instances details

Outputable ClosureTypeInfo # |
Instance details Defined in SMRep Methods ppr :: ClosureTypeInfo -> SDoc Source # pprPrec :: Rational -> ClosureTypeInfo -> SDoc Source #

data ProfilingInfo Source #

Constructors

NoProfilingInfo |
ProfilingInfo [Word8] [Word8] |

type ConstrDescription = [Word8] Source #

# Statements, expressions and types

module CmmNode

module CmmExpr