llvm-hs-pure-9.0.0: Pure Haskell LLVM functionality (no FFI).
Safe HaskellSafe
LanguageHaskell2010

LLVM.AST

Description

This module and descendants define AST data types to represent LLVM code. Note that these types are designed for fidelity rather than convenience - if the truth of what LLVM supports is less than pretty, so be it.

Synopsis

Documentation

data Module Source #

Constructors

Module 

Instances

Instances details
Eq Module Source # 
Instance details

Defined in LLVM.AST

Methods

(==) :: Module -> Module -> Bool #

(/=) :: Module -> Module -> Bool #

Data Module Source # 
Instance details

Defined in LLVM.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Module -> c Module #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Module #

toConstr :: Module -> Constr #

dataTypeOf :: Module -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Module) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module) #

gmapT :: (forall b. Data b => b -> b) -> Module -> Module #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r #

gmapQ :: (forall d. Data d => d -> u) -> Module -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Module -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Module -> m Module #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module #

Read Module Source # 
Instance details

Defined in LLVM.AST

Show Module Source # 
Instance details

Defined in LLVM.AST

Generic Module Source # 
Instance details

Defined in LLVM.AST

Associated Types

type Rep Module :: Type -> Type #

Methods

from :: Module -> Rep Module x #

to :: Rep Module x -> Module #

type Rep Module Source # 
Instance details

Defined in LLVM.AST

defaultModule :: Module Source #

helper for making Modules

data Definition Source #

Any thing which can be at the top level of a Module

Instances

Instances details
Eq Definition Source # 
Instance details

Defined in LLVM.AST

Data Definition Source # 
Instance details

Defined in LLVM.AST

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Definition -> c Definition #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Definition #

toConstr :: Definition -> Constr #

dataTypeOf :: Definition -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Definition) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Definition) #

gmapT :: (forall b. Data b => b -> b) -> Definition -> Definition #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Definition -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Definition -> r #

gmapQ :: (forall d. Data d => d -> u) -> Definition -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Definition -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Definition -> m Definition #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Definition -> m Definition #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Definition -> m Definition #

Read Definition Source # 
Instance details

Defined in LLVM.AST

Show Definition Source # 
Instance details

Defined in LLVM.AST

Generic Definition Source # 
Instance details

Defined in LLVM.AST

Associated Types

type Rep Definition :: Type -> Type #

type Rep Definition Source # 
Instance details

Defined in LLVM.AST

type Rep Definition = D1 ('MetaData "Definition" "LLVM.AST" "llvm-hs-pure-9.0.0-inplace" 'False) ((C1 ('MetaCons "GlobalDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Global)) :+: (C1 ('MetaCons "TypeDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Type))) :+: C1 ('MetaCons "MetadataNodeDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MetadataNodeID) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MDNode)))) :+: ((C1 ('MetaCons "NamedMetadataDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [MetadataNodeID])) :+: C1 ('MetaCons "ModuleInlineAssembly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) :+: (C1 ('MetaCons "FunctionAttributes" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupID) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FunctionAttribute])) :+: C1 ('MetaCons "COMDAT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SelectionKind)))))

data Global Source #

Instances

Instances details
Eq Global Source # 
Instance details

Defined in LLVM.AST.Global

Methods

(==) :: Global -> Global -> Bool #

(/=) :: Global -> Global -> Bool #

Data Global Source # 
Instance details

Defined in LLVM.AST.Global

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Global -> c Global #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Global #

toConstr :: Global -> Constr #

dataTypeOf :: Global -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Global) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Global) #

gmapT :: (forall b. Data b => b -> b) -> Global -> Global #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Global -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Global -> r #

gmapQ :: (forall d. Data d => d -> u) -> Global -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Global -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Global -> m Global #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Global -> m Global #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Global -> m Global #

Read Global Source # 
Instance details

Defined in LLVM.AST.Global

Show Global Source # 
Instance details

Defined in LLVM.AST.Global

Generic Global Source # 
Instance details

Defined in LLVM.AST.Global

Associated Types

type Rep Global :: Type -> Type #

Methods

from :: Global -> Rep Global x #

to :: Rep Global x -> Global #

Typed Global Source # 
Instance details

Defined in LLVM.AST.Typed

Methods

typeOf :: Global -> Type Source #

type Rep Global Source # 
Instance details

Defined in LLVM.AST.Global

type Rep Global = D1 ('MetaData "Global" "LLVM.AST.Global" "llvm-hs-pure-9.0.0-inplace" 'False) (C1 ('MetaCons "GlobalVariable" 'PrefixI 'True) (((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: (S1 ('MetaSel ('Just "linkage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Linkage) :*: S1 ('MetaSel ('Just "visibility") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Visibility))) :*: ((S1 ('MetaSel ('Just "dllStorageClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StorageClass)) :*: S1 ('MetaSel ('Just "threadLocalMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Model))) :*: (S1 ('MetaSel ('Just "unnamedAddr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UnnamedAddr)) :*: S1 ('MetaSel ('Just "isConstant") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "type'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type) :*: (S1 ('MetaSel ('Just "addrSpace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AddrSpace) :*: S1 ('MetaSel ('Just "initializer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Constant)))) :*: ((S1 ('MetaSel ('Just "section") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ShortByteString)) :*: S1 ('MetaSel ('Just "comdat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ShortByteString))) :*: (S1 ('MetaSel ('Just "alignment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32) :*: S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(ShortByteString, MDRef MDNode)]))))) :+: (C1 ('MetaCons "GlobalAlias" 'PrefixI 'True) (((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Just "linkage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Linkage)) :*: (S1 ('MetaSel ('Just "visibility") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Visibility) :*: S1 ('MetaSel ('Just "dllStorageClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StorageClass)))) :*: ((S1 ('MetaSel ('Just "threadLocalMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Model)) :*: S1 ('MetaSel ('Just "unnamedAddr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UnnamedAddr))) :*: (S1 ('MetaSel ('Just "type'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type) :*: (S1 ('MetaSel ('Just "addrSpace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AddrSpace) :*: S1 ('MetaSel ('Just "aliasee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Constant))))) :+: C1 ('MetaCons "Function" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "linkage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Linkage) :*: S1 ('MetaSel ('Just "visibility") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Visibility)) :*: (S1 ('MetaSel ('Just "dllStorageClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe StorageClass)) :*: S1 ('MetaSel ('Just "callingConvention") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CallingConvention))) :*: ((S1 ('MetaSel ('Just "returnAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ParameterAttribute]) :*: S1 ('MetaSel ('Just "returnType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ([Parameter], Bool))))) :*: (((S1 ('MetaSel ('Just "functionAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Either GroupID FunctionAttribute]) :*: S1 ('MetaSel ('Just "section") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ShortByteString))) :*: (S1 ('MetaSel ('Just "comdat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ShortByteString)) :*: S1 ('MetaSel ('Just "alignment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) :*: ((S1 ('MetaSel ('Just "garbageCollectorName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ShortByteString)) :*: S1 ('MetaSel ('Just "prefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Constant))) :*: (S1 ('MetaSel ('Just "basicBlocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [BasicBlock]) :*: (S1 ('MetaSel ('Just "personalityFunction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Constant)) :*: S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(ShortByteString, MDRef MDNode)]))))))))

functionDefaults :: Global Source #

helper for making Functions

data UnnamedAddr Source #

Constructors

LocalAddr 
GlobalAddr 

Instances

Instances details
Eq UnnamedAddr Source # 
Instance details

Defined in LLVM.AST.Global

Data UnnamedAddr Source # 
Instance details

Defined in LLVM.AST.Global

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnnamedAddr -> c UnnamedAddr #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnnamedAddr #

toConstr :: UnnamedAddr -> Constr #

dataTypeOf :: UnnamedAddr -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnnamedAddr) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnnamedAddr) #

gmapT :: (forall b. Data b => b -> b) -> UnnamedAddr -> UnnamedAddr #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnnamedAddr -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnnamedAddr -> r #

gmapQ :: (forall d. Data d => d -> u) -> UnnamedAddr -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UnnamedAddr -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnnamedAddr -> m UnnamedAddr #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnnamedAddr -> m UnnamedAddr #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnnamedAddr -> m UnnamedAddr #

Read UnnamedAddr Source # 
Instance details

Defined in LLVM.AST.Global

Show UnnamedAddr Source # 
Instance details

Defined in LLVM.AST.Global

Generic UnnamedAddr Source # 
Instance details

Defined in LLVM.AST.Global

Associated Types

type Rep UnnamedAddr :: Type -> Type #

type Rep UnnamedAddr Source # 
Instance details

Defined in LLVM.AST.Global

type Rep UnnamedAddr = D1 ('MetaData "UnnamedAddr" "LLVM.AST.Global" "llvm-hs-pure-9.0.0-inplace" 'False) (C1 ('MetaCons "LocalAddr" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GlobalAddr" 'PrefixI 'False) (U1 :: Type -> Type))

data Parameter Source #

Instances

Instances details
Eq Parameter Source # 
Instance details

Defined in LLVM.AST.Global

Data Parameter Source # 
Instance details

Defined in LLVM.AST.Global

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Parameter -> c Parameter #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Parameter #

toConstr :: Parameter -> Constr #

dataTypeOf :: Parameter -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Parameter) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Parameter) #

gmapT :: (forall b. Data b => b -> b) -> Parameter -> Parameter #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Parameter -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Parameter -> r #

gmapQ :: (forall d. Data d => d -> u) -> Parameter -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Parameter -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Parameter -> m Parameter #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Parameter -> m Parameter #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Parameter -> m Parameter #

Read Parameter Source # 
Instance details

Defined in LLVM.AST.Global

Show Parameter Source # 
Instance details

Defined in LLVM.AST.Global

Generic Parameter Source # 
Instance details

Defined in LLVM.AST.Global

Associated Types

type Rep Parameter :: Type -> Type #

Typed Parameter Source # 
Instance details

Defined in LLVM.AST.Typed

type Rep Parameter Source # 
Instance details

Defined in LLVM.AST.Global

data BasicBlock Source #

http://llvm.org/doxygen/classllvm_1_1BasicBlock.html LLVM code in a function is a sequence of BasicBlocks each with a label, some instructions, and a terminator.

Instances

Instances details
Eq BasicBlock Source # 
Instance details

Defined in LLVM.AST.Global

Data BasicBlock Source # 
Instance details

Defined in LLVM.AST.Global

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BasicBlock -> c BasicBlock #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BasicBlock #

toConstr :: BasicBlock -> Constr #

dataTypeOf :: BasicBlock -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BasicBlock) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BasicBlock) #

gmapT :: (forall b. Data b => b -> b) -> BasicBlock -> BasicBlock #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BasicBlock -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BasicBlock -> r #

gmapQ :: (forall d. Data d => d -> u) -> BasicBlock -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BasicBlock -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BasicBlock -> m BasicBlock #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BasicBlock -> m BasicBlock #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BasicBlock -> m BasicBlock #

Read BasicBlock Source # 
Instance details

Defined in LLVM.AST.Global

Show BasicBlock Source # 
Instance details

Defined in LLVM.AST.Global

Generic BasicBlock Source # 
Instance details

Defined in LLVM.AST.Global

Associated Types

type Rep BasicBlock :: Type -> Type #

type Rep BasicBlock Source # 
Instance details

Defined in LLVM.AST.Global

data Operand Source #

An Operand is roughly that which is an argument to an Instruction

Instances

Instances details
Eq Operand Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

(==) :: Operand -> Operand -> Bool #

(/=) :: Operand -> Operand -> Bool #

Data Operand Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Operand -> c Operand #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Operand #

toConstr :: Operand -> Constr #

dataTypeOf :: Operand -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Operand) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Operand) #

gmapT :: (forall b. Data b => b -> b) -> Operand -> Operand #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Operand -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Operand -> r #

gmapQ :: (forall d. Data d => d -> u) -> Operand -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Operand -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Operand -> m Operand #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Operand -> m Operand #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Operand -> m Operand #

Ord Operand Source # 
Instance details

Defined in LLVM.AST.Operand

Read Operand Source # 
Instance details

Defined in LLVM.AST.Operand

Show Operand Source # 
Instance details

Defined in LLVM.AST.Operand

Generic Operand Source # 
Instance details

Defined in LLVM.AST.Operand

Associated Types

type Rep Operand :: Type -> Type #

Methods

from :: Operand -> Rep Operand x #

to :: Rep Operand x -> Operand #

Typed CallableOperand Source # 
Instance details

Defined in LLVM.AST.Typed

Typed Operand Source # 
Instance details

Defined in LLVM.AST.Typed

Methods

typeOf :: Operand -> Type Source #

type Rep Operand Source # 
Instance details

Defined in LLVM.AST.Operand

type CallableOperand = Either InlineAssembly Operand Source #

The Call instruction is special: the callee can be inline assembly

data Metadata Source #

Instances

Instances details
Eq Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

Data Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Metadata -> c Metadata #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Metadata #

toConstr :: Metadata -> Constr #

dataTypeOf :: Metadata -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Metadata) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Metadata) #

gmapT :: (forall b. Data b => b -> b) -> Metadata -> Metadata #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Metadata -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Metadata -> r #

gmapQ :: (forall d. Data d => d -> u) -> Metadata -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Metadata -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Metadata -> m Metadata #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Metadata -> m Metadata #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Metadata -> m Metadata #

Ord Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

Read Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

Show Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

Generic Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

Associated Types

type Rep Metadata :: Type -> Type #

Methods

from :: Metadata -> Rep Metadata x #

to :: Rep Metadata x -> Metadata #

type Rep Metadata Source # 
Instance details

Defined in LLVM.AST.Operand

newtype MetadataNodeID Source #

A MetadataNodeID is a number for identifying a metadata node. Note this is different from "named metadata", which are represented with NamedMetadataDefinition.

Constructors

MetadataNodeID Word 

Instances

Instances details
Eq MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

Data MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MetadataNodeID -> c MetadataNodeID #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MetadataNodeID #

toConstr :: MetadataNodeID -> Constr #

dataTypeOf :: MetadataNodeID -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MetadataNodeID) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MetadataNodeID) #

gmapT :: (forall b. Data b => b -> b) -> MetadataNodeID -> MetadataNodeID #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MetadataNodeID -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MetadataNodeID -> r #

gmapQ :: (forall d. Data d => d -> u) -> MetadataNodeID -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MetadataNodeID -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MetadataNodeID -> m MetadataNodeID #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MetadataNodeID -> m MetadataNodeID #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MetadataNodeID -> m MetadataNodeID #

Ord MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

Read MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

Show MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

Generic MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

Associated Types

type Rep MetadataNodeID :: Type -> Type #

type Rep MetadataNodeID Source # 
Instance details

Defined in LLVM.AST.Operand

type Rep MetadataNodeID = D1 ('MetaData "MetadataNodeID" "LLVM.AST.Operand" "llvm-hs-pure-9.0.0-inplace" 'True) (C1 ('MetaCons "MetadataNodeID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word)))

data MDRef a Source #

MDRef can either represent a reference to some piece of metadata or the metadata itself.

This is mainly useful for encoding cyclic metadata. Note that LLVM represents inline and non-inline nodes identically, so roundtripping the Haskell AST does not preserve whether a node was inline or not.

Constructors

MDRef MetadataNodeID 
MDInline a 

Instances

Instances details
Functor MDRef Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

fmap :: (a -> b) -> MDRef a -> MDRef b #

(<$) :: a -> MDRef b -> MDRef a #

Eq a => Eq (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

(==) :: MDRef a -> MDRef a -> Bool #

(/=) :: MDRef a -> MDRef a -> Bool #

Data a => Data (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MDRef a -> c (MDRef a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MDRef a) #

toConstr :: MDRef a -> Constr #

dataTypeOf :: MDRef a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MDRef a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MDRef a)) #

gmapT :: (forall b. Data b => b -> b) -> MDRef a -> MDRef a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MDRef a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MDRef a -> r #

gmapQ :: (forall d. Data d => d -> u) -> MDRef a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MDRef a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MDRef a -> m (MDRef a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MDRef a -> m (MDRef a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MDRef a -> m (MDRef a) #

Ord a => Ord (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

compare :: MDRef a -> MDRef a -> Ordering #

(<) :: MDRef a -> MDRef a -> Bool #

(<=) :: MDRef a -> MDRef a -> Bool #

(>) :: MDRef a -> MDRef a -> Bool #

(>=) :: MDRef a -> MDRef a -> Bool #

max :: MDRef a -> MDRef a -> MDRef a #

min :: MDRef a -> MDRef a -> MDRef a #

Read a => Read (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

Show a => Show (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

showsPrec :: Int -> MDRef a -> ShowS #

show :: MDRef a -> String #

showList :: [MDRef a] -> ShowS #

Generic (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

Associated Types

type Rep (MDRef a) :: Type -> Type #

Methods

from :: MDRef a -> Rep (MDRef a) x #

to :: Rep (MDRef a) x -> MDRef a #

type Rep (MDRef a) Source # 
Instance details

Defined in LLVM.AST.Operand

type Rep (MDRef a) = D1 ('MetaData "MDRef" "LLVM.AST.Operand" "llvm-hs-pure-9.0.0-inplace" 'False) (C1 ('MetaCons "MDRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MetadataNodeID)) :+: C1 ('MetaCons "MDInline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

data MDNode Source #

Instances

Instances details
Eq MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

(==) :: MDNode -> MDNode -> Bool #

(/=) :: MDNode -> MDNode -> Bool #

Data MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MDNode -> c MDNode #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MDNode #

toConstr :: MDNode -> Constr #

dataTypeOf :: MDNode -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MDNode) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MDNode) #

gmapT :: (forall b. Data b => b -> b) -> MDNode -> MDNode #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MDNode -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MDNode -> r #

gmapQ :: (forall d. Data d => d -> u) -> MDNode -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MDNode -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MDNode -> m MDNode #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MDNode -> m MDNode #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MDNode -> m MDNode #

Ord MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

Read MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

Show MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

Generic MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

Associated Types

type Rep MDNode :: Type -> Type #

Methods

from :: MDNode -> Rep MDNode x #

to :: Rep MDNode x -> MDNode #

type Rep MDNode Source # 
Instance details

Defined in LLVM.AST.Operand

data Type Source #

Instances

Instances details
Eq Type Source # 
Instance details

Defined in LLVM.AST.Type

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Data Type Source # 
Instance details

Defined in LLVM.AST.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type #

toConstr :: Type -> Constr #

dataTypeOf :: Type -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) #

gmapT :: (forall b. Data b => b -> b) -> Type -> Type #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r #

gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type #

Ord Type Source # 
Instance details

Defined in LLVM.AST.Type

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Read Type Source # 
Instance details

Defined in LLVM.AST.Type

Show Type Source # 
Instance details

Defined in LLVM.AST.Type

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Generic Type Source # 
Instance details

Defined in LLVM.AST.Type

Associated Types

type Rep Type :: Type -> Type #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

type Rep Type Source # 
Instance details

Defined in LLVM.AST.Type

type Rep Type = D1 ('MetaData "Type" "LLVM.AST.Type" "llvm-hs-pure-9.0.0-inplace" 'False) (((C1 ('MetaCons "VoidType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IntegerType" 'PrefixI 'True) (S1 ('MetaSel ('Just "typeBits") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: C1 ('MetaCons "PointerType" 'PrefixI 'True) (S1 ('MetaSel ('Just "pointerReferent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type) :*: S1 ('MetaSel ('Just "pointerAddrSpace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AddrSpace)))) :+: (C1 ('MetaCons "FloatingPointType" 'PrefixI 'True) (S1 ('MetaSel ('Just "floatingPointType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FloatingPointType)) :+: (C1 ('MetaCons "FunctionType" 'PrefixI 'True) (S1 ('MetaSel ('Just "resultType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type) :*: (S1 ('MetaSel ('Just "argumentTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Type]) :*: S1 ('MetaSel ('Just "isVarArg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :+: C1 ('MetaCons "VectorType" 'PrefixI 'True) (S1 ('MetaSel ('Just "nVectorElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32) :*: S1 ('MetaSel ('Just "elementType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type))))) :+: ((C1 ('MetaCons "StructureType" 'PrefixI 'True) (S1 ('MetaSel ('Just "isPacked") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "elementTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Type])) :+: (C1 ('MetaCons "ArrayType" 'PrefixI 'True) (S1 ('MetaSel ('Just "nArrayElements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just "elementType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: C1 ('MetaCons "NamedTypeReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)))) :+: (C1 ('MetaCons "MetadataType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LabelType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TokenType" 'PrefixI 'False) (U1 :: Type -> Type)))))

data FloatingPointType Source #

LLVM supports some special formats floating point format. This type is to distinguish those format. Also see http://llvm.org/docs/LangRef.html#floating-point-types

Constructors

HalfFP

16-bit floating point value

FloatFP

32-bit floating point value

DoubleFP

64-bit floating point value

FP128FP

128-bit floating point value (112-bit mantissa)

X86_FP80FP

80-bit floating point value (X87)

PPC_FP128FP

128-bit floating point value (two 64-bits)

Instances

Instances details
Eq FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

Data FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FloatingPointType -> c FloatingPointType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FloatingPointType #

toConstr :: FloatingPointType -> Constr #

dataTypeOf :: FloatingPointType -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FloatingPointType) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FloatingPointType) #

gmapT :: (forall b. Data b => b -> b) -> FloatingPointType -> FloatingPointType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FloatingPointType -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FloatingPointType -> r #

gmapQ :: (forall d. Data d => d -> u) -> FloatingPointType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FloatingPointType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FloatingPointType -> m FloatingPointType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FloatingPointType -> m FloatingPointType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FloatingPointType -> m FloatingPointType #

Ord FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

Read FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

Show FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

Generic FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

Associated Types

type Rep FloatingPointType :: Type -> Type #

type Rep FloatingPointType Source # 
Instance details

Defined in LLVM.AST.Type

type Rep FloatingPointType = D1 ('MetaData "FloatingPointType" "LLVM.AST.Type" "llvm-hs-pure-9.0.0-inplace" 'False) ((C1 ('MetaCons "HalfFP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FloatFP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DoubleFP" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "FP128FP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "X86_FP80FP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PPC_FP128FP" 'PrefixI 'False) (U1 :: Type -> Type))))

Overview

llvm-hs-pure defines the Haskell AST for representing an LLVM Module. For interacting with the LLVM C/C++ libraries and an overview of the various libraries in the llvm-hs ecosystem, take a look at the docs in the LLVM module in llvm-hs.

In addition to constructing the LLVM AST manually, there is also a monadic IRBuilder interface in IRBuilder. The IRBuilder will take care of generating fresh names automatically and generally reduces the verbosity of using the AST directly. Using RecursiveDo/mdo, it is also capable of handling forward references automatically.

Constructing the AST for an LLVM module