llvm-0.6.6.0: Bindings to the LLVM compiler toolkit.Source codeContentsIndex
LLVM.FFI.Core
Portabilityrequires GHC 6.8, LLVM
Stabilityexperimental
Maintainerbos@serpentine.com
Contents
Modules
Module providers
Types
Integer types
Real types
Function types
Other types
Array, pointer, and vector types
Struct types
Type handles
Values
Constants
Global variables, functions, and aliases (globals)
Global variables
Functions
Phi nodes
Calling conventions
Constants
Scalar constants
Composite constants
Constant expressions
Basic blocks
Instruction building
Terminators
Arithmetic
Memory
Casts
Comparisons
Miscellaneous instructions
Other helpers
Memory buffers
Error handling
Parameter passing
Pass manager
Description
This module provides direct access to the LLVM C bindings.
Synopsis
data Module
type ModuleRef = Ptr Module
moduleCreateWithName :: CString -> IO ModuleRef
disposeModule :: ModuleRef -> IO ()
ptrDisposeModule :: FunPtr (ModuleRef -> IO ())
getDataLayout :: ModuleRef -> IO CString
setDataLayout :: ModuleRef -> CString -> IO ()
getTarget :: ModuleRef -> IO CString
setTarget :: ModuleRef -> CString -> IO ()
data ModuleProvider
type ModuleProviderRef = Ptr ModuleProvider
createModuleProviderForExistingModule :: ModuleRef -> IO ModuleProviderRef
ptrDisposeModuleProvider :: FunPtr (ModuleProviderRef -> IO ())
data Type
type TypeRef = Ptr Type
addTypeName :: ModuleRef -> CString -> TypeRef -> IO CInt
deleteTypeName :: ModuleRef -> CString -> IO ()
getTypeKind :: TypeRef -> IO TypeKind
data TypeKind
= VoidTypeKind
| FloatTypeKind
| DoubleTypeKind
| X86_FP80TypeKind
| FP128TypeKind
| PPC_FP128TypeKind
| LabelTypeKind
| IntegerTypeKind
| FunctionTypeKind
| StructTypeKind
| ArrayTypeKind
| PointerTypeKind
| OpaqueTypeKind
| VectorTypeKind
int1Type :: TypeRef
int8Type :: TypeRef
int16Type :: TypeRef
int32Type :: TypeRef
int64Type :: TypeRef
integerType :: CUInt -> TypeRef
getIntTypeWidth :: TypeRef -> IO CUInt
floatType :: TypeRef
doubleType :: TypeRef
x86FP80Type :: TypeRef
fp128Type :: TypeRef
ppcFP128Type :: TypeRef
functionType :: TypeRef -> Ptr TypeRef -> CUInt -> CInt -> TypeRef
isFunctionVarArg :: TypeRef -> IO CInt
getReturnType :: TypeRef -> IO TypeRef
countParamTypes :: TypeRef -> IO CUInt
getParamTypes :: TypeRef -> Ptr TypeRef -> IO ()
voidType :: TypeRef
labelType :: TypeRef
opaqueType :: TypeRef
arrayType :: TypeRef -> CUInt -> TypeRef
pointerType :: TypeRef -> CUInt -> TypeRef
vectorType :: TypeRef -> CUInt -> TypeRef
getElementType :: TypeRef -> IO TypeRef
getArrayLength :: TypeRef -> IO CUInt
getPointerAddressSpace :: TypeRef -> IO CUInt
getVectorSize :: TypeRef -> IO CUInt
structType :: Ptr TypeRef -> CUInt -> CInt -> IO TypeRef
countStructElementTypes :: TypeRef -> IO CUInt
getStructElementTypes :: TypeRef -> Ptr TypeRef -> IO ()
isPackedStruct :: TypeRef -> IO CInt
createTypeHandle :: TypeRef -> IO TypeHandleRef
refineType :: TypeRef -> TypeRef -> IO ()
resolveTypeHandle :: TypeHandleRef -> IO TypeRef
disposeTypeHandle :: TypeHandleRef -> IO ()
data Value
type ValueRef = Ptr Value
typeOf :: ValueRef -> IO TypeRef
getValueName :: ValueRef -> IO CString
setValueName :: ValueRef -> CString -> IO ()
dumpValue :: ValueRef -> IO ()
constNull :: TypeRef -> ValueRef
constAllOnes :: TypeRef -> ValueRef
getUndef :: TypeRef -> ValueRef
isConstant :: ValueRef -> IO CInt
isNull :: ValueRef -> IO CInt
isUndef :: ValueRef -> IO CInt
type Linkage = CUInt
type Visibility = CUInt
isDeclaration :: ValueRef -> IO CInt
getLinkage :: ValueRef -> IO Linkage
setLinkage :: ValueRef -> Linkage -> IO ()
getSection :: ValueRef -> IO CString
setSection :: ValueRef -> CString -> IO ()
getVisibility :: ValueRef -> IO Visibility
setVisibility :: ValueRef -> Visibility -> IO ()
getAlignment :: ValueRef -> IO CUInt
setAlignment :: ValueRef -> CUInt -> IO ()
addGlobal :: ModuleRef -> TypeRef -> CString -> IO ValueRef
getNamedGlobal :: ModuleRef -> CString -> IO ValueRef
deleteGlobal :: ValueRef -> IO ()
getInitializer :: ValueRef -> IO ValueRef
setInitializer :: ValueRef -> ValueRef -> IO ()
isThreadLocal :: ValueRef -> IO CInt
setThreadLocal :: ValueRef -> CInt -> IO ()
isGlobalConstant :: ValueRef -> IO CInt
setGlobalConstant :: ValueRef -> CInt -> IO ()
getFirstGlobal :: ModuleRef -> IO ValueRef
getNextGlobal :: ValueRef -> IO ValueRef
getPreviousGlobal :: ValueRef -> IO ValueRef
getLastGlobal :: ModuleRef -> IO ValueRef
getGlobalParent :: ValueRef -> IO ModuleRef
addFunction :: ModuleRef -> CString -> TypeRef -> IO ValueRef
getNamedFunction :: ModuleRef -> CString -> IO ValueRef
deleteFunction :: ValueRef -> IO ()
countParams :: ValueRef -> CUInt
getParams :: ValueRef -> Ptr ValueRef -> IO ()
getParam :: ValueRef -> CUInt -> ValueRef
getIntrinsicID :: ValueRef -> CUInt
getGC :: ValueRef -> IO CString
setGC :: ValueRef -> CString -> IO ()
getFirstFunction :: ModuleRef -> IO ValueRef
getNextFunction :: ValueRef -> IO ValueRef
getPreviousFunction :: ValueRef -> IO ValueRef
getLastFunction :: ModuleRef -> IO ValueRef
getFirstParam :: ValueRef -> IO ValueRef
getNextParam :: ValueRef -> IO ValueRef
getPreviousParam :: ValueRef -> IO ValueRef
getLastParam :: ValueRef -> IO ValueRef
getParamParent :: ValueRef -> IO ValueRef
isTailCall :: ValueRef -> IO CInt
setTailCall :: ValueRef -> CInt -> IO ()
addIncoming :: ValueRef -> Ptr ValueRef -> Ptr ValueRef -> CUInt -> IO ()
countIncoming :: ValueRef -> IO CUInt
getIncomingValue :: ValueRef -> CUInt -> IO ValueRef
getIncomingBlock :: ValueRef -> CUInt -> IO BasicBlockRef
data CallingConvention
= C
| Fast
| Cold
| X86StdCall
| X86FastCall
fromCallingConvention :: CallingConvention -> CUInt
toCallingConvention :: CUInt -> CallingConvention
getFunctionCallConv :: ValueRef -> IO CUInt
setFunctionCallConv :: ValueRef -> CUInt -> IO ()
getInstructionCallConv :: ValueRef -> IO CUInt
setInstructionCallConv :: ValueRef -> CUInt -> IO ()
constInt :: TypeRef -> CULLong -> CInt -> ValueRef
constReal :: TypeRef -> CDouble -> ValueRef
constArray :: TypeRef -> Ptr ValueRef -> CUInt -> ValueRef
constString :: CString -> CUInt -> CInt -> ValueRef
constStruct :: Ptr ValueRef -> CUInt -> CInt -> ValueRef
constVector :: Ptr ValueRef -> CUInt -> ValueRef
sizeOf :: TypeRef -> IO ValueRef
constNeg :: ValueRef -> ValueRef
constNot :: ValueRef -> ValueRef
constAdd :: ValueRef -> ValueRef -> ValueRef
constSub :: ValueRef -> ValueRef -> ValueRef
constMul :: ValueRef -> ValueRef -> ValueRef
constUDiv :: ValueRef -> ValueRef -> ValueRef
constSDiv :: ValueRef -> ValueRef -> ValueRef
constFDiv :: ValueRef -> ValueRef -> ValueRef
constURem :: ValueRef -> ValueRef -> ValueRef
constSRem :: ValueRef -> ValueRef -> ValueRef
constFRem :: ValueRef -> ValueRef -> ValueRef
constAnd :: ValueRef -> ValueRef -> ValueRef
constOr :: ValueRef -> ValueRef -> ValueRef
constXor :: ValueRef -> ValueRef -> ValueRef
constICmp :: CInt -> ValueRef -> ValueRef -> ValueRef
constFCmp :: CInt -> ValueRef -> ValueRef -> ValueRef
constShl :: ValueRef -> ValueRef -> ValueRef
constLShr :: ValueRef -> ValueRef -> ValueRef
constAShr :: ValueRef -> ValueRef -> ValueRef
constGEP :: ValueRef -> Ptr ValueRef -> CUInt -> ValueRef
constTrunc :: ValueRef -> TypeRef -> ValueRef
constSExt :: ValueRef -> TypeRef -> ValueRef
constZExt :: ValueRef -> TypeRef -> ValueRef
constFPTrunc :: ValueRef -> TypeRef -> ValueRef
constFPExt :: ValueRef -> TypeRef -> ValueRef
constUIToFP :: ValueRef -> TypeRef -> ValueRef
constSIToFP :: ValueRef -> TypeRef -> ValueRef
constFPToUI :: ValueRef -> TypeRef -> ValueRef
constFPToSI :: ValueRef -> TypeRef -> ValueRef
constPtrToInt :: ValueRef -> TypeRef -> ValueRef
constIntToPtr :: ValueRef -> TypeRef -> ValueRef
constBitCast :: ValueRef -> TypeRef -> ValueRef
constSelect :: ValueRef -> ValueRef -> ValueRef -> ValueRef
constExtractElement :: ValueRef -> ValueRef -> ValueRef
constInsertElement :: ValueRef -> ValueRef -> ValueRef -> ValueRef
constShuffleVector :: ValueRef -> ValueRef -> ValueRef -> ValueRef
constRealOfString :: TypeRef -> CString -> IO ValueRef
type BasicBlock = Value
type BasicBlockRef = Ptr BasicBlock
basicBlockAsValue :: BasicBlockRef -> ValueRef
valueIsBasicBlock :: ValueRef -> Bool
valueAsBasicBlock :: ValueRef -> BasicBlockRef
countBasicBlocks :: ValueRef -> IO CUInt
getBasicBlocks :: ValueRef -> Ptr BasicBlockRef -> IO ()
getEntryBasicBlock :: ValueRef -> IO BasicBlockRef
appendBasicBlock :: ValueRef -> CString -> IO BasicBlockRef
insertBasicBlock :: BasicBlockRef -> CString -> IO BasicBlockRef
deleteBasicBlock :: BasicBlockRef -> IO ()
getFirstBasicBlock :: ValueRef -> IO BasicBlockRef
getNextBasicBlock :: BasicBlockRef -> IO BasicBlockRef
getPreviousBasicBlock :: BasicBlockRef -> IO BasicBlockRef
getLastBasicBlock :: ValueRef -> IO BasicBlockRef
getInsertBlock :: BuilderRef -> IO BasicBlockRef
getBasicBlockParent :: BasicBlockRef -> IO ValueRef
data Builder
type BuilderRef = Ptr Builder
createBuilder :: IO BuilderRef
ptrDisposeBuilder :: FunPtr (BuilderRef -> IO ())
positionBuilder :: BuilderRef -> BasicBlockRef -> ValueRef -> IO ()
positionBefore :: BuilderRef -> ValueRef -> IO ()
positionAtEnd :: BuilderRef -> BasicBlockRef -> IO ()
getFirstInstruction :: BasicBlockRef -> IO ValueRef
getNextInstruction :: ValueRef -> IO ValueRef
getPreviousInstruction :: ValueRef -> IO ValueRef
getLastInstruction :: BasicBlockRef -> IO ValueRef
getInstructionParent :: ValueRef -> IO BasicBlockRef
buildRetVoid :: BuilderRef -> IO ValueRef
buildRet :: BuilderRef -> ValueRef -> IO ValueRef
buildBr :: BuilderRef -> BasicBlockRef -> IO ValueRef
buildCondBr :: BuilderRef -> ValueRef -> BasicBlockRef -> BasicBlockRef -> IO ValueRef
buildSwitch :: BuilderRef -> ValueRef -> BasicBlockRef -> CUInt -> IO ValueRef
buildInvoke :: BuilderRef -> ValueRef -> Ptr ValueRef -> CUInt -> BasicBlockRef -> BasicBlockRef -> CString -> IO ValueRef
buildUnwind :: BuilderRef -> IO ValueRef
buildUnreachable :: BuilderRef -> IO ValueRef
buildAdd :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildSub :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildMul :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildUDiv :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildSDiv :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildFDiv :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildURem :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildSRem :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildFRem :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildShl :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildLShr :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildAShr :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildAnd :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildOr :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildXor :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildNeg :: BuilderRef -> ValueRef -> CString -> IO ValueRef
buildNot :: BuilderRef -> ValueRef -> CString -> IO ValueRef
buildMalloc :: BuilderRef -> TypeRef -> CString -> IO ValueRef
buildArrayMalloc :: BuilderRef -> TypeRef -> ValueRef -> CString -> IO ValueRef
buildAlloca :: BuilderRef -> TypeRef -> CString -> IO ValueRef
buildArrayAlloca :: BuilderRef -> TypeRef -> ValueRef -> CString -> IO ValueRef
buildFree :: BuilderRef -> ValueRef -> IO ValueRef
buildLoad :: BuilderRef -> ValueRef -> CString -> IO ValueRef
buildStore :: BuilderRef -> ValueRef -> ValueRef -> IO ValueRef
buildGEP :: BuilderRef -> ValueRef -> Ptr ValueRef -> CUInt -> CString -> IO ValueRef
buildTrunc :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildZExt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildSExt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildFPToUI :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildFPToSI :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildUIToFP :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildSIToFP :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildFPTrunc :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildFPExt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildPtrToInt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildIntToPtr :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildBitCast :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildICmp :: BuilderRef -> CInt -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildFCmp :: BuilderRef -> CInt -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildPhi :: BuilderRef -> TypeRef -> CString -> IO ValueRef
buildCall :: BuilderRef -> ValueRef -> Ptr ValueRef -> CUInt -> CString -> IO ValueRef
buildSelect :: BuilderRef -> ValueRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildVAArg :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRef
buildExtractElement :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildInsertElement :: BuilderRef -> ValueRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
buildShuffleVector :: BuilderRef -> ValueRef -> ValueRef -> ValueRef -> CString -> IO ValueRef
addCase :: ValueRef -> ValueRef -> BasicBlockRef -> IO ()
data MemoryBuffer
type MemoryBufferRef = Ptr MemoryBuffer
createMemoryBufferWithContentsOfFile :: CString -> Ptr MemoryBufferRef -> Ptr CString -> IO CInt
createMemoryBufferWithSTDIN :: Ptr MemoryBufferRef -> Ptr CString -> IO CInt
disposeMemoryBuffer :: MemoryBufferRef -> IO ()
disposeMessage :: CString -> IO ()
addInstrAttribute :: ValueRef -> CUInt -> CAttribute -> IO ()
addAttribute :: ValueRef -> CAttribute -> IO ()
removeInstrAttribute :: ValueRef -> CUInt -> CAttribute -> IO ()
removeAttribute :: ValueRef -> CAttribute -> IO ()
setInstrParamAlignment :: ValueRef -> CUInt -> CUInt -> IO ()
setParamAlignment :: ValueRef -> CUInt -> IO ()
data Attribute
= ZExtAttribute
| SExtAttribute
| NoReturnAttribute
| InRegAttribute
| StructRetAttribute
| NoUnwindAttribute
| NoAliasAttribute
| ByValAttribute
| NestAttribute
| ReadNoneAttribute
| ReadOnlyAttribute
fromAttribute :: Attribute -> CAttribute
toAttribute :: CAttribute -> Attribute
data PassManager
type PassManagerRef = Ptr PassManager
createFunctionPassManager :: ModuleProviderRef -> IO PassManagerRef
createPassManager :: IO PassManagerRef
ptrDisposePassManager :: FunPtr (PassManagerRef -> IO ())
finalizeFunctionPassManager :: PassManagerRef -> IO CInt
initializeFunctionPassManager :: PassManagerRef -> IO CInt
runFunctionPassManager :: PassManagerRef -> ValueRef -> IO CInt
runPassManager :: PassManagerRef -> ModuleRef -> IO CInt
dumpModule :: ModuleRef -> IO ()
Modules
data Module Source
type ModuleRef = Ptr ModuleSource
moduleCreateWithName :: CString -> IO ModuleRefSource
disposeModule :: ModuleRef -> IO ()Source
ptrDisposeModule :: FunPtr (ModuleRef -> IO ())Source
getDataLayout :: ModuleRef -> IO CStringSource
setDataLayout :: ModuleRef -> CString -> IO ()Source
getTarget :: ModuleRef -> IO CStringSource
setTarget :: ModuleRef -> CString -> IO ()Source
Module providers
data ModuleProvider Source
type ModuleProviderRef = Ptr ModuleProviderSource
createModuleProviderForExistingModule :: ModuleRef -> IO ModuleProviderRefSource
ptrDisposeModuleProvider :: FunPtr (ModuleProviderRef -> IO ())Source
Types
data Type Source
type TypeRef = Ptr TypeSource
addTypeName :: ModuleRef -> CString -> TypeRef -> IO CIntSource
deleteTypeName :: ModuleRef -> CString -> IO ()Source
getTypeKind :: TypeRef -> IO TypeKindSource
data TypeKind Source
Constructors
VoidTypeKind
FloatTypeKind
DoubleTypeKind
X86_FP80TypeKind
FP128TypeKind
PPC_FP128TypeKind
LabelTypeKind
IntegerTypeKind
FunctionTypeKind
StructTypeKind
ArrayTypeKind
PointerTypeKind
OpaqueTypeKind
VectorTypeKind
show/hide Instances
Integer types
int1Type :: TypeRefSource
int8Type :: TypeRefSource
int16Type :: TypeRefSource
int32Type :: TypeRefSource
int64Type :: TypeRefSource
integerTypeSource
:: CUIntwidth in bits
-> TypeRef
An integer type of the given width.
getIntTypeWidth :: TypeRef -> IO CUIntSource
Real types
floatType :: TypeRefSource
doubleType :: TypeRefSource
x86FP80Type :: TypeRefSource
fp128Type :: TypeRefSource
ppcFP128Type :: TypeRefSource
Function types
functionTypeSource
:: TypeRefreturn type
-> Ptr TypeRefarray of argument types
-> CUIntnumber of elements in array
-> CIntnon-zero if function is varargs
-> TypeRef
Create a function type.
isFunctionVarArg :: TypeRef -> IO CIntSource
Indicate whether a function takes varargs.
getReturnType :: TypeRef -> IO TypeRefSource
Give a function's return type.
countParamTypes :: TypeRef -> IO CUIntSource
Give the number of fixed parameters that a function takes.
getParamTypes :: TypeRef -> Ptr TypeRef -> IO ()Source
Fill out an array with the types of a function's fixed parameters.
Other types
voidType :: TypeRefSource
labelType :: TypeRefSource
opaqueType :: TypeRefSource
Array, pointer, and vector types
arrayTypeSource
:: TypeRefelement type
-> CUIntelement count
-> TypeRef
pointerTypeSource
:: TypeRefpointed-to type
-> CUIntaddress space
-> TypeRef
vectorTypeSource
:: TypeRefelement type
-> CUIntelement count
-> TypeRef
getElementType :: TypeRef -> IO TypeRefSource
Get the type of a sequential type's elements.
getArrayLength :: TypeRef -> IO CUIntSource
getPointerAddressSpace :: TypeRef -> IO CUIntSource
getVectorSize :: TypeRef -> IO CUIntSource
Struct types
structType :: Ptr TypeRef -> CUInt -> CInt -> IO TypeRefSource
countStructElementTypes :: TypeRef -> IO CUIntSource
getStructElementTypes :: TypeRef -> Ptr TypeRef -> IO ()Source
isPackedStruct :: TypeRef -> IO CIntSource
Type handles
createTypeHandle :: TypeRef -> IO TypeHandleRefSource
refineType :: TypeRef -> TypeRef -> IO ()Source
resolveTypeHandle :: TypeHandleRef -> IO TypeRefSource
disposeTypeHandle :: TypeHandleRef -> IO ()Source
Values
data Value Source
type ValueRef = Ptr ValueSource
typeOf :: ValueRef -> IO TypeRefSource
getValueName :: ValueRef -> IO CStringSource
setValueName :: ValueRef -> CString -> IO ()Source
dumpValue :: ValueRef -> IO ()Source
Constants
constNull :: TypeRef -> ValueRefSource
constAllOnes :: TypeRef -> ValueRefSource
getUndef :: TypeRef -> ValueRefSource
isConstant :: ValueRef -> IO CIntSource
isNull :: ValueRef -> IO CIntSource
isUndef :: ValueRef -> IO CIntSource
Global variables, functions, and aliases (globals)
type Linkage = CUIntSource
type Visibility = CUIntSource
isDeclaration :: ValueRef -> IO CIntSource
getLinkage :: ValueRef -> IO LinkageSource
setLinkage :: ValueRef -> Linkage -> IO ()Source
getSection :: ValueRef -> IO CStringSource
setSection :: ValueRef -> CString -> IO ()Source
getVisibility :: ValueRef -> IO VisibilitySource
setVisibility :: ValueRef -> Visibility -> IO ()Source
getAlignment :: ValueRef -> IO CUIntSource
setAlignment :: ValueRef -> CUInt -> IO ()Source
Global variables
addGlobal :: ModuleRef -> TypeRef -> CString -> IO ValueRefSource
getNamedGlobal :: ModuleRef -> CString -> IO ValueRefSource
deleteGlobal :: ValueRef -> IO ()Source
getInitializer :: ValueRef -> IO ValueRefSource
setInitializer :: ValueRef -> ValueRef -> IO ()Source
isThreadLocal :: ValueRef -> IO CIntSource
setThreadLocal :: ValueRef -> CInt -> IO ()Source
isGlobalConstant :: ValueRef -> IO CIntSource
setGlobalConstant :: ValueRef -> CInt -> IO ()Source
getFirstGlobal :: ModuleRef -> IO ValueRefSource
getNextGlobal :: ValueRef -> IO ValueRefSource
getPreviousGlobal :: ValueRef -> IO ValueRefSource
getLastGlobal :: ModuleRef -> IO ValueRefSource
getGlobalParent :: ValueRef -> IO ModuleRefSource
Functions
addFunctionSource
:: ModuleRefmodule
-> CStringname
-> TypeReftype
-> IO ValueRef
getNamedFunctionSource
:: ModuleRefmodule
-> CStringname
-> IO ValueReffunction (nullPtr if not found)
deleteFunctionSource
:: ValueReffunction
-> IO ()
countParamsSource
:: ValueReffunction
-> CUInt
getParamsSource
:: ValueReffunction
-> Ptr ValueRefarray to fill out
-> IO ()
getParamSource
:: ValueReffunction
-> CUIntoffset into array
-> ValueRef
getIntrinsicIDSource
:: ValueReffunction
-> CUInt
getGC :: ValueRef -> IO CStringSource
setGC :: ValueRef -> CString -> IO ()Source
getFirstFunction :: ModuleRef -> IO ValueRefSource
getNextFunction :: ValueRef -> IO ValueRefSource
getPreviousFunction :: ValueRef -> IO ValueRefSource
getLastFunction :: ModuleRef -> IO ValueRefSource
getFirstParam :: ValueRef -> IO ValueRefSource
getNextParam :: ValueRef -> IO ValueRefSource
getPreviousParam :: ValueRef -> IO ValueRefSource
getLastParam :: ValueRef -> IO ValueRefSource
getParamParent :: ValueRef -> IO ValueRefSource
isTailCall :: ValueRef -> IO CIntSource
setTailCall :: ValueRef -> CInt -> IO ()Source
Phi nodes
addIncoming :: ValueRef -> Ptr ValueRef -> Ptr ValueRef -> CUInt -> IO ()Source
countIncoming :: ValueRef -> IO CUIntSource
getIncomingValue :: ValueRef -> CUInt -> IO ValueRefSource
getIncomingBlock :: ValueRef -> CUInt -> IO BasicBlockRefSource
Calling conventions
data CallingConvention Source
Constructors
C
Fast
Cold
X86StdCall
X86FastCall
show/hide Instances
fromCallingConvention :: CallingConvention -> CUIntSource
toCallingConvention :: CUInt -> CallingConventionSource
getFunctionCallConvSource
:: ValueReffunction
-> IO CUInt
setFunctionCallConvSource
:: ValueReffunction
-> CUInt
-> IO ()
getInstructionCallConv :: ValueRef -> IO CUIntSource
setInstructionCallConv :: ValueRef -> CUInt -> IO ()Source
Constants
Scalar constants
constInt :: TypeRef -> CULLong -> CInt -> ValueRefSource
constReal :: TypeRef -> CDouble -> ValueRefSource
Composite constants
constArray :: TypeRef -> Ptr ValueRef -> CUInt -> ValueRefSource
constString :: CString -> CUInt -> CInt -> ValueRefSource
constStruct :: Ptr ValueRef -> CUInt -> CInt -> ValueRefSource
constVector :: Ptr ValueRef -> CUInt -> ValueRefSource
Constant expressions
sizeOf :: TypeRef -> IO ValueRefSource
constNeg :: ValueRef -> ValueRefSource
constNot :: ValueRef -> ValueRefSource
constAdd :: ValueRef -> ValueRef -> ValueRefSource
constSub :: ValueRef -> ValueRef -> ValueRefSource
constMul :: ValueRef -> ValueRef -> ValueRefSource
constUDiv :: ValueRef -> ValueRef -> ValueRefSource
constSDiv :: ValueRef -> ValueRef -> ValueRefSource
constFDiv :: ValueRef -> ValueRef -> ValueRefSource
constURem :: ValueRef -> ValueRef -> ValueRefSource
constSRem :: ValueRef -> ValueRef -> ValueRefSource
constFRem :: ValueRef -> ValueRef -> ValueRefSource
constAnd :: ValueRef -> ValueRef -> ValueRefSource
constOr :: ValueRef -> ValueRef -> ValueRefSource
constXor :: ValueRef -> ValueRef -> ValueRefSource
constICmp :: CInt -> ValueRef -> ValueRef -> ValueRefSource
constFCmp :: CInt -> ValueRef -> ValueRef -> ValueRefSource
constShl :: ValueRef -> ValueRef -> ValueRefSource
constLShr :: ValueRef -> ValueRef -> ValueRefSource
constAShr :: ValueRef -> ValueRef -> ValueRefSource
constGEP :: ValueRef -> Ptr ValueRef -> CUInt -> ValueRefSource
constTrunc :: ValueRef -> TypeRef -> ValueRefSource
constSExt :: ValueRef -> TypeRef -> ValueRefSource
constZExt :: ValueRef -> TypeRef -> ValueRefSource
constFPTrunc :: ValueRef -> TypeRef -> ValueRefSource
constFPExt :: ValueRef -> TypeRef -> ValueRefSource
constUIToFP :: ValueRef -> TypeRef -> ValueRefSource
constSIToFP :: ValueRef -> TypeRef -> ValueRefSource
constFPToUI :: ValueRef -> TypeRef -> ValueRefSource
constFPToSI :: ValueRef -> TypeRef -> ValueRefSource
constPtrToInt :: ValueRef -> TypeRef -> ValueRefSource
constIntToPtr :: ValueRef -> TypeRef -> ValueRefSource
constBitCast :: ValueRef -> TypeRef -> ValueRefSource
constSelect :: ValueRef -> ValueRef -> ValueRef -> ValueRefSource
constExtractElement :: ValueRef -> ValueRef -> ValueRefSource
constInsertElement :: ValueRef -> ValueRef -> ValueRef -> ValueRefSource
constShuffleVector :: ValueRef -> ValueRef -> ValueRef -> ValueRefSource
constRealOfString :: TypeRef -> CString -> IO ValueRefSource
Basic blocks
type BasicBlock = ValueSource
type BasicBlockRef = Ptr BasicBlockSource
basicBlockAsValue :: BasicBlockRef -> ValueRefSource
valueIsBasicBlock :: ValueRef -> BoolSource
valueAsBasicBlockSource
:: ValueRefbasic block
-> BasicBlockRef
countBasicBlocksSource
:: ValueReffunction
-> IO CUInt
getBasicBlocksSource
:: ValueReffunction
-> Ptr BasicBlockRefarray to fill out
-> IO ()
getEntryBasicBlockSource
:: ValueReffunction
-> IO BasicBlockRef
appendBasicBlockSource
:: ValueReffunction
-> CStringname for label
-> IO BasicBlockRef
insertBasicBlockSource
:: BasicBlockRefinsert before this one
-> CStringname for label
-> IO BasicBlockRef
deleteBasicBlock :: BasicBlockRef -> IO ()Source
getFirstBasicBlock :: ValueRef -> IO BasicBlockRefSource
getNextBasicBlock :: BasicBlockRef -> IO BasicBlockRefSource
getPreviousBasicBlock :: BasicBlockRef -> IO BasicBlockRefSource
getLastBasicBlock :: ValueRef -> IO BasicBlockRefSource
getInsertBlock :: BuilderRef -> IO BasicBlockRefSource
getBasicBlockParent :: BasicBlockRef -> IO ValueRefSource
Instruction building
data Builder Source
type BuilderRef = Ptr BuilderSource
createBuilder :: IO BuilderRefSource
ptrDisposeBuilder :: FunPtr (BuilderRef -> IO ())Source
positionBuilder :: BuilderRef -> BasicBlockRef -> ValueRef -> IO ()Source
positionBefore :: BuilderRef -> ValueRef -> IO ()Source
positionAtEnd :: BuilderRef -> BasicBlockRef -> IO ()Source
getFirstInstruction :: BasicBlockRef -> IO ValueRefSource
getNextInstruction :: ValueRef -> IO ValueRefSource
getPreviousInstruction :: ValueRef -> IO ValueRefSource
getLastInstruction :: BasicBlockRef -> IO ValueRefSource
getInstructionParent :: ValueRef -> IO BasicBlockRefSource
Terminators
buildRetVoid :: BuilderRef -> IO ValueRefSource
buildRet :: BuilderRef -> ValueRef -> IO ValueRefSource
buildBr :: BuilderRef -> BasicBlockRef -> IO ValueRefSource
buildCondBr :: BuilderRef -> ValueRef -> BasicBlockRef -> BasicBlockRef -> IO ValueRefSource
buildSwitch :: BuilderRef -> ValueRef -> BasicBlockRef -> CUInt -> IO ValueRefSource
buildInvoke :: BuilderRef -> ValueRef -> Ptr ValueRef -> CUInt -> BasicBlockRef -> BasicBlockRef -> CString -> IO ValueRefSource
buildUnwind :: BuilderRef -> IO ValueRefSource
buildUnreachable :: BuilderRef -> IO ValueRefSource
Arithmetic
buildAdd :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildSub :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildMul :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildUDiv :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildSDiv :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildFDiv :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildURem :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildSRem :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildFRem :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildShl :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildLShr :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildAShr :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildAnd :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildOr :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildXor :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildNeg :: BuilderRef -> ValueRef -> CString -> IO ValueRefSource
buildNot :: BuilderRef -> ValueRef -> CString -> IO ValueRefSource
Memory
buildMalloc :: BuilderRef -> TypeRef -> CString -> IO ValueRefSource
buildArrayMalloc :: BuilderRef -> TypeRef -> ValueRef -> CString -> IO ValueRefSource
buildAlloca :: BuilderRef -> TypeRef -> CString -> IO ValueRefSource
buildArrayAlloca :: BuilderRef -> TypeRef -> ValueRef -> CString -> IO ValueRefSource
buildFree :: BuilderRef -> ValueRef -> IO ValueRefSource
buildLoad :: BuilderRef -> ValueRef -> CString -> IO ValueRefSource
buildStore :: BuilderRef -> ValueRef -> ValueRef -> IO ValueRefSource
buildGEP :: BuilderRef -> ValueRef -> Ptr ValueRef -> CUInt -> CString -> IO ValueRefSource
Casts
buildTrunc :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildZExt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildSExt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildFPToUI :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildFPToSI :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildUIToFP :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildSIToFP :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildFPTrunc :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildFPExt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildPtrToInt :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildIntToPtr :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildBitCast :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
Comparisons
buildICmp :: BuilderRef -> CInt -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildFCmp :: BuilderRef -> CInt -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
Miscellaneous instructions
buildPhi :: BuilderRef -> TypeRef -> CString -> IO ValueRefSource
buildCall :: BuilderRef -> ValueRef -> Ptr ValueRef -> CUInt -> CString -> IO ValueRefSource
buildSelect :: BuilderRef -> ValueRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildVAArg :: BuilderRef -> ValueRef -> TypeRef -> CString -> IO ValueRefSource
buildExtractElement :: BuilderRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildInsertElement :: BuilderRef -> ValueRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
buildShuffleVector :: BuilderRef -> ValueRef -> ValueRef -> ValueRef -> CString -> IO ValueRefSource
Other helpers
addCase :: ValueRef -> ValueRef -> BasicBlockRef -> IO ()Source
Memory buffers
data MemoryBuffer Source
type MemoryBufferRef = Ptr MemoryBufferSource
createMemoryBufferWithContentsOfFile :: CString -> Ptr MemoryBufferRef -> Ptr CString -> IO CIntSource
createMemoryBufferWithSTDIN :: Ptr MemoryBufferRef -> Ptr CString -> IO CIntSource
disposeMemoryBuffer :: MemoryBufferRef -> IO ()Source
Error handling
disposeMessage :: CString -> IO ()Source
Parameter passing
addInstrAttribute :: ValueRef -> CUInt -> CAttribute -> IO ()Source
addAttribute :: ValueRef -> CAttribute -> IO ()Source
removeInstrAttribute :: ValueRef -> CUInt -> CAttribute -> IO ()Source
removeAttribute :: ValueRef -> CAttribute -> IO ()Source
setInstrParamAlignment :: ValueRef -> CUInt -> CUInt -> IO ()Source
setParamAlignment :: ValueRef -> CUInt -> IO ()Source
data Attribute Source
Constructors
ZExtAttribute
SExtAttribute
NoReturnAttribute
InRegAttribute
StructRetAttribute
NoUnwindAttribute
NoAliasAttribute
ByValAttribute
NestAttribute
ReadNoneAttribute
ReadOnlyAttribute
show/hide Instances
fromAttribute :: Attribute -> CAttributeSource
toAttribute :: CAttribute -> AttributeSource
Pass manager
data PassManager Source
type PassManagerRef = Ptr PassManagerSource
createFunctionPassManager :: ModuleProviderRef -> IO PassManagerRefSource
createPassManager :: IO PassManagerRefSource
ptrDisposePassManager :: FunPtr (PassManagerRef -> IO ())Source
finalizeFunctionPassManager :: PassManagerRef -> IO CIntSource
initializeFunctionPassManager :: PassManagerRef -> IO CIntSource
runFunctionPassManager :: PassManagerRef -> ValueRef -> IO CIntSource
runPassManager :: PassManagerRef -> ModuleRef -> IO CIntSource
dumpModule :: ModuleRef -> IO ()Source
Produced by Haddock version 2.4.2