llvm-base-3.2.0.2: FFI bindings to the LLVM compiler toolkit.

Safe HaskellNone

LLVM.ST

Synopsis

Documentation

data CUInt

Haskell type representing the C unsigned int type.

data CULLong

Haskell type representing the C unsigned long long type.

data IntPredicate Source

Constructors

IntEQ

equal

IntNE

not equal

IntUGT

unsigned greater than

IntUGE

unsigned greater or equal

IntULT

unsigned less than

IntULE

unsigned less or equal

IntSGT

signed greater than

IntSGE

signed greater or equal

IntSLT

signed less than

IntSLE

signed less or equal

data FPPredicate Source

Constructors

FPFalse

Always false (always folded)

FPOEQ

True if ordered and equal

FPOGT

True if ordered and greater than

FPOGE

True if ordered and greater than or equal

FPOLT

True if ordered and less than

FPOLE

True if ordered and less than or equal

FPONE

True if ordered and operands are unequal

FPORD

True if ordered (no nans)

FPUNO

True if unordered: isnan(X) | isnan(Y)

FPUEQ

True if unordered or equal

FPUGT

True if unordered or greater than

FPUGE

True if unordered, greater than, or equal

FPULT

True if unordered or less than

FPULE

True if unordered, less than, or equal

FPUNE

True if unordered or not equal

FPT

Always true (always folded)

data LLVM c s a Source

Instances

class MonadLLVM m whereSource

Methods

getContext :: m c s ContextSource

liftLL :: LLVM c s a -> m c s aSource

liftST :: ST s a -> m c s aSource

run :: Context -> (forall c s. LLVM c s (STModule c s)) -> ModuleSource

run2 :: Context -> (forall c s. LLVM c s (STModule c s, a)) -> (Module, a)Source

runLLVM :: Context -> (forall c. LLVM c s a) -> ST s aSource

data STPassManager c s Source

Instances

class MonadLLVM m => MonadMG m whereSource

Methods

liftMG :: ModuleGen c s a -> m c s aSource

runModuleGen :: (Monad (m c s), MonadLLVM m) => STModule c s -> ModuleGen c s a -> m c s aSource

data STModule c s Source

Instances

data Module Source

Instances

unsafeFreeze :: (Monad (m c s), MonadLLVM m) => STModule c s -> m c s ModuleSource

unsafeThaw :: (Monad (m c s), MonadLLVM m) => Module -> m c s (STModule c s)Source

parseBitcode :: (Functor (m c s), Monad (m c s), MonadLLVM m) => MemoryBuffer -> m c s (Either String (STModule c s))Source

getModule :: MonadMG m => m c s (STModule c s)Source

genModule :: (Monad (m c s), MonadLLVM m) => String -> ModuleGen c s a -> m c s aSource

showModule :: (Monad (m c s), MonadLLVM m) => STModule c s -> m c s StringSource

linkModules :: (Monad (m c s), MonadLLVM m) => STModule c s -> STModule c s -> m c s (Maybe String)Source

data STBasicBlock c s Source

Instances

appendBasicBlock :: (Monad (m c s), MonadLLVM m) => String -> STValue c s -> m c s (STBasicBlock c s)Source

data STValue c s Source

Instances

Eq (STValue c s) 

data Linkage Source

An enumeration for the kinds of linkage for global values.

Constructors

ExternalLinkage

Externally visible function

AvailableExternallyLinkage 
LinkOnceAnyLinkage

Keep one copy of function when linking (inline)

LinkOnceODRLinkage

Same, but only replaced by something equivalent.

WeakAnyLinkage

Keep one copy of named function when linking (weak)

WeakODRLinkage

Same, but only replaced by something equivalent.

AppendingLinkage

Special purpose, only applies to global arrays

InternalLinkage

Rename collisions when linking (static functions)

PrivateLinkage

Like Internal, but omit from symbol table

DLLImportLinkage

Function to be imported from DLL

DLLExportLinkage

Function to be accessible from DLL

ExternalWeakLinkage

ExternalWeak linkage description

GhostLinkage

Stand-in functions for streaming fns from BC files

CommonLinkage

Tentative definitions

LinkerPrivateLinkage

Like Private, but linker removes.

showValue :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s StringSource

typeOf :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s (STType c s)Source

findGlobal :: MonadMG m => String -> m c s (Maybe (STValue c s))Source

findFunction :: MonadMG m => String -> m c s (Maybe (STValue c s))Source

addFunction :: MonadMG m => String -> STType c s -> m c s (STValue c s)Source

genFunction :: (Functor (m c s), Monad (m c s), MonadMG m) => String -> STType c s -> CodeGen c s a -> m c s aSource

defineFunction :: (Functor (m c s), Monad (m c s), MonadMG m) => STValue c s -> CodeGen c s a -> m c s aSource

runCodeGen :: (Monad (m c s), MonadMG m) => STValue c s -> CodeGen c s a -> ModuleGen c s aSource

setFuncCallConv :: (Monad (m c s), MonadLLVM m) => STValue c s -> CallingConvention -> m c s ()Source

setInstrCallConv :: (Monad (m c s), MonadLLVM m) => STValue c s -> CallingConvention -> m c s ()Source

getFunctionParams :: (Functor (m c s), Monad (m c s), MonadLLVM m) => STValue c s -> m c s [STValue c s]Source

addParamAttrib :: (Monad (m c s), MonadLLVM m) => STValue c s -> Attribute -> m c s ()Source

addFuncAttrib :: (Monad (m c s), MonadLLVM m) => STValue c s -> Attribute -> m c s ()Source

removeAttrib :: (Monad (m c s), MonadLLVM m) => STValue c s -> Attribute -> m c s ()Source

getLinkage :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s LinkageSource

setLinkage :: (Monad (m c s), MonadLLVM m) => STValue c s -> Linkage -> m c s ()Source

getTailCall :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s BoolSource

setTailCall :: (Monad (m c s), MonadLLVM m) => STValue c s -> Bool -> m c s ()Source

verifyFunction :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s BoolSource

getUndef :: (Monad (m c s), MonadLLVM m) => STType c s -> m c s (STValue c s)Source

isConstant :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s BoolSource

isNull :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s BoolSource

isUndef :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s BoolSource

isUnreachable :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s BoolSource

constInt :: (Monad (m c s), MonadLLVM m) => STType c s -> CULLong -> Bool -> m c s (STValue c s)Source

constPtrNull :: (Monad (m c s), MonadLLVM m) => STType c s -> m c s (STValue c s)Source

constString :: (Monad (m c s), MonadLLVM m) => String -> Bool -> m c s (STValue c s)Source

constStruct :: (Monad (m c s), MonadLLVM m) => [STValue c s] -> Bool -> m c s (STValue c s)Source

data STType c s Source

Instances

Eq (STType c s) 

typeKind :: (Monad (m c s), MonadLLVM m) => STType c s -> m c s TypeKindSource

showType :: (Monad (m c s), MonadLLVM m) => STType c s -> m c s StringSource

findType :: MonadMG m => String -> m c s (Maybe (STType c s))Source

sizeOf :: (Monad (m c s), MonadLLVM m) => STType c s -> m c s (STValue c s)Source

intType :: (Monad (m c s), MonadLLVM m) => CUInt -> m c s (STType c s)Source

floatType :: (Monad (m c s), MonadLLVM m) => m c s (STType c s)Source

doubleType :: (Monad (m c s), MonadLLVM m) => m c s (STType c s)Source

voidType :: (Monad (m c s), MonadLLVM m) => m c s (STType c s)Source

functionType :: (Monad (m c s), MonadLLVM m) => STType c s -> [STType c s] -> Bool -> m c s (STType c s)Source

structType :: (Monad (m c s), MonadLLVM m) => [STType c s] -> Bool -> m c s (STType c s)Source

vectorType :: (Monad (m c s), MonadLLVM m) => STType c s -> CUInt -> m c s (STType c s)Source

arrayType :: (Monad (m c s), MonadLLVM m) => STType c s -> CUInt -> m c s (STType c s)Source

pointerTypeInSpace :: (Monad (m c s), MonadLLVM m) => STType c s -> CUInt -> m c s (STType c s)Source

pointerType :: (Monad (m c s), MonadLLVM m) => STType c s -> m c s (STType c s)Source

structCreateNamed :: (Monad (m c s), MonadLLVM m) => String -> m c s (STType c s)Source

structSetBody :: (Monad (m c s), MonadLLVM m) => STType c s -> [STType c s] -> Bool -> m c s ()Source

class MonadMG m => MonadCG m whereSource

Methods

liftCG :: CodeGen c s a -> m c s aSource

Instances

position :: MonadCG m => STBasicBlock c s -> STValue c s -> m c s ()Source

positionAtEnd :: MonadCG m => STBasicBlock c s -> m c s ()Source

positionBefore :: MonadCG m => STValue c s -> m c s ()Source

positionAfter :: MonadCG m => STValue c s -> m c s ()Source

getFunction :: MonadCG m => m c s (STValue c s)Source

getParams :: MonadCG m => m c s [STValue c s]Source

getValueName :: (Monad (m c s), MonadLLVM m) => STValue c s -> m c s StringSource

setValueName :: (Monad (m c s), MonadLLVM m) => STValue c s -> String -> m c s ()Source

buildTrunc :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildZExt :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildSExt :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildFPToUI :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildFPToSI :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildUIToFP :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildSIToFP :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildFPTrunc :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildFPExt :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildPtrToInt :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildIntToPtr :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildBitCast :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildPointerCast :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildTruncOrBitCast :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildZExtOrBitCast :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildSExtOrBitCast :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildInBoundsGEP :: (Monad (m c s), MonadCG m) => String -> STValue c s -> [STValue c s] -> m c s (STValue c s)Source

buildAlloca :: (Monad (m c s), MonadCG m) => String -> STType c s -> m c s (STValue c s)Source

buildLoad :: (Monad (m c s), MonadCG m) => String -> STValue c s -> m c s (STValue c s)Source

buildStore :: (Monad (m c s), MonadCG m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

buildCall :: (Monad (m c s), MonadCG m) => String -> STValue c s -> [STValue c s] -> m c s (STValue c s)Source

buildBr :: (Monad (m c s), MonadCG m) => STBasicBlock c s -> m c s (STValue c s)Source

buildCondBr :: (Monad (m c s), MonadCG m) => STValue c s -> STBasicBlock c s -> STBasicBlock c s -> m c s (STValue c s)Source

buildSwitch :: (Monad (m c s), MonadCG m) => STValue c s -> STBasicBlock c s -> CUInt -> m c s (STValue c s)Source

addCase :: (Monad (m c s), MonadCG m) => STValue c s -> STValue c s -> STBasicBlock c b -> m c s ()Source

buildPhi :: (Monad (m c s), MonadCG m) => String -> STType c s -> m c s (STValue c s)Source

addIncoming :: (Monad (m c s), MonadCG m) => STValue c s -> [(STValue c s, STBasicBlock c s)] -> m c s ()Source

buildCase :: (Functor (m c s), Monad (m c s), MonadCG m) => STValue c s -> m c s (STValue c s) -> [(STValue c s, m c s (STValue c s))] -> m c s (STValue c s)Source

buildIf :: (Monad (m c s), MonadCG m) => STType c s -> STValue c s -> m c s (STValue c s) -> m c s (STValue c s) -> m c s (STValue c s)Source

buildRet :: (Monad (m c s), MonadCG m) => STValue c s -> m c s (STValue c s)Source

buildUnreachable :: (Monad (m c s), MonadCG m) => m c s (STValue c s)Source

buildAdd :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildSub :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildMul :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildFAdd :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildFMul :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildFPCast :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STType c s -> m c s (STValue c s)Source

buildFSub :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildUDiv :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildSDiv :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildExactSDiv :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildFDiv :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildURem :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildSRem :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildFRem :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildShl :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildLShr :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildAShr :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildAnd :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildOr :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildXor :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildNeg :: (Monad (m c s), MonadCG m) => String -> STValue c s -> m c s (STValue c s)Source

buildFNeg :: (Monad (m c s), MonadCG m) => String -> STValue c s -> m c s (STValue c s)Source

buildNot :: (Monad (m c s), MonadCG m) => String -> STValue c s -> m c s (STValue c s)Source

buildNSWAdd :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildNSWMul :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildNSWNeg :: (Monad (m c s), MonadCG m) => String -> STValue c s -> m c s (STValue c s)Source

buildNSWSub :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildNUWAdd :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildNUWMul :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildNUWNeg :: (Monad (m c s), MonadCG m) => String -> STValue c s -> m c s (STValue c s)Source

buildNUWSub :: (Monad (m c s), MonadCG m) => String -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildICmp :: (Monad (m c s), MonadCG m) => String -> IntPredicate -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildFCmp :: (Monad (m c s), MonadCG m) => String -> FPPredicate -> STValue c s -> STValue c s -> m c s (STValue c s)Source

buildGlobalString :: (Monad (m c s), MonadCG m) => String -> String -> m c s (STValue c s)Source

buildGlobalStringPtr :: (Monad (m c s), MonadCG m) => String -> String -> m c s (STValue c s)Source

constAdd :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constSub :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constMul :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constFAdd :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constFMul :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constFPCast :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constFSub :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constUDiv :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constSDiv :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constFDiv :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constURem :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constSRem :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constFRem :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constAnd :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constOr :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constXor :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constShl :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constLShr :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constAShr :: (Monad (m c s), MonadLLVM m) => STValue c s -> STValue c s -> m c s (STValue c s)Source

constGEP :: (Monad (m c s), MonadCG m) => STValue c s -> [STValue c s] -> m c s (STValue c s)Source

constTrunc :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constSExt :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constZExt :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constFPTrunc :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constFPExt :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constUIToFP :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constSIToFP :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constFPToUI :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constFPToSI :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constPtrToInt :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constIntToPtr :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source

constBitCast :: (Monad (m c s), MonadLLVM m) => STValue c s -> STType c s -> m c s (STValue c s)Source