ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

Llvm.MetaData

Contents

- Metadata can be constructed in a few different ways (See below).
- After which it can either be attached to LLVM statements to pass along
- Metadata expressions -- these are the raw metadata values that encode
- Metadata nodes -- global metadata variables that attach a metadata
- Named metadata -- global metadata variables that attach a metadata nodes
- Attach to instructions -- metadata can be attached to LLVM instructions
- As arguments -- llvm functions can take metadata as arguments, for
- As a named metadata -- Here the metadata is simply declared in global

Synopsis

- newtype MetaId = MetaId Int
- data MetaExpr
  - = MetaStr !LMString
  - | MetaNode !MetaId
  - | MetaVar !LlvmVar
  - | MetaStruct [MetaExpr]
- data MetaAnnot = MetaAnnot LMString MetaExpr
- data MetaDecl
  - = MetaNamed !LMString [MetaId]
  - | MetaUnnamed !MetaId !MetaExpr

# Metadata can be constructed in a few different ways (See below).

# After which it can either be attached to LLVM statements to pass along

# Metadata expressions -- these are the raw metadata values that encode

# Metadata nodes -- global metadata variables that attach a metadata

# Named metadata -- global metadata variables that attach a metadata nodes

# Attach to instructions -- metadata can be attached to LLVM instructions

# As arguments -- llvm functions can take metadata as arguments, for

# As a named metadata -- Here the metadata is simply declared in global

newtype MetaId #

A reference to an un-named metadata node.

Constructors

MetaId Int |

Instances

Enum MetaId # |
Methods succ :: MetaId -> MetaId Source # pred :: MetaId -> MetaId Source # toEnum :: Int -> MetaId Source # fromEnum :: MetaId -> Int Source # enumFrom :: MetaId -> [MetaId] Source # enumFromThen :: MetaId -> MetaId -> [MetaId] Source # enumFromTo :: MetaId -> MetaId -> [MetaId] Source # enumFromThenTo :: MetaId -> MetaId -> MetaId -> [MetaId] Source #
Eq MetaId # |
Methods (==) :: MetaId -> MetaId -> Bool # (/=) :: MetaId -> MetaId -> Bool #
Ord MetaId # |
Methods compare :: MetaId -> MetaId -> Ordering # (<) :: MetaId -> MetaId -> Bool # (<=) :: MetaId -> MetaId -> Bool # (>) :: MetaId -> MetaId -> Bool # (>=) :: MetaId -> MetaId -> Bool # max :: MetaId -> MetaId -> MetaId # min :: MetaId -> MetaId -> MetaId #
Outputable MetaId # |
Methods ppr :: MetaId -> SDoc # pprPrec :: Rational -> MetaId -> SDoc #

data MetaExpr #

LLVM metadata expressions

Constructors

MetaStr !LMString |
MetaNode !MetaId |
MetaVar !LlvmVar |
MetaStruct [MetaExpr] |

Instances

Eq MetaExpr # |
Methods (==) :: MetaExpr -> MetaExpr -> Bool # (/=) :: MetaExpr -> MetaExpr -> Bool #
Outputable MetaExpr # |
Methods ppr :: MetaExpr -> SDoc # pprPrec :: Rational -> MetaExpr -> SDoc #

data MetaAnnot #

Associates some metadata with a specific label for attaching to an instruction.

Constructors

MetaAnnot LMString MetaExpr |

Instances

Eq MetaAnnot # |
Methods (==) :: MetaAnnot -> MetaAnnot -> Bool # (/=) :: MetaAnnot -> MetaAnnot -> Bool #

data MetaDecl #

Metadata declarations. Metadata can only be declared in global scope.

Constructors

MetaNamed !LMString [MetaId] | Named metadata. Only used for communicating module information to LLVM. ('!name = !{ [!n] }' form).
MetaUnnamed !MetaId !MetaExpr | Metadata node declaration. ('!0 = metadata !{ expression }' form).