Safe Haskell | None |
---|
LLVM.Wrapper.Core
Contents
- module LLVM.FFI.Core
- type Context = ForeignPtr Context
- getGlobalContext :: IO Context
- contextCreate :: IO Context
- type MemoryBuffer = ForeignPtr MemoryBuffer
- createMemoryBufferWithContentsOfFile :: FilePath -> IO MemoryBuffer
- createMemoryBufferWithSTDIN :: IO MemoryBuffer
- createMemoryBufferWithMemoryRange :: Ptr a -> CSize -> String -> Bool -> IO MemoryBuffer
- createMemoryBufferWithMemoryRangeCopy :: Ptr a -> CSize -> String -> IO MemoryBuffer
- data Module
- moduleCreateWithName :: String -> IO Module
- moduleCreateWithNameInContext :: String -> Context -> IO Module
- printModuleToFile :: Module -> FilePath -> IO ()
- dumpModule :: Module -> IO ()
- type Type = TypeRef
- intTypeInContext :: Context -> CUInt -> IO Type
- floatTypeInContext :: Context -> IO Type
- doubleTypeInContext :: Context -> IO Type
- x86FP80TypeInContext :: Context -> IO Type
- voidTypeInContext :: Context -> IO Type
- functionType :: Type -> [Type] -> Bool -> Type
- structType :: [Type] -> Bool -> Type
- structTypeInContext :: Context -> [Type] -> Bool -> IO Type
- structCreateNamed :: String -> IO Type
- structCreateNamedInContext :: Context -> String -> IO Type
- structSetBody :: Type -> [Type] -> Bool -> IO ()
- getTypeByName :: Module -> String -> IO (Maybe Type)
- type Value = ValueRef
- getValueName :: Value -> IO String
- setValueName :: Value -> String -> IO ()
- getGC :: Value -> IO String
- setGC :: Value -> String -> IO ()
- getLinkage :: Value -> IO Linkage
- setLinkage :: Value -> Linkage -> IO ()
- constStructInContext :: Context -> [Value] -> Bool -> IO Value
- constRealOfString :: Type -> String -> Value
- constString :: String -> Bool -> Value
- constStringInContext :: Context -> String -> Bool -> IO Value
- addGlobal :: Module -> Type -> String -> IO Value
- getNamedGlobal :: Module -> String -> IO (Maybe Value)
- buildGlobalString :: Builder -> String -> String -> IO Value
- buildGlobalStringPtr :: Builder -> String -> String -> IO Value
- data PassManager
- createPassManager :: IO PassManager
- runPassManager :: PassManager -> Module -> IO Bool
- createFunctionPassManagerForModule :: Module -> IO PassManager
- initializeFunctionPassManager :: PassManager -> IO Bool
- runFunctionPassManager :: PassManager -> Value -> IO Bool
- finalizeFunctionPassManager :: PassManager -> IO Bool
- addFunction :: Module -> String -> Type -> IO Value
- getNamedFunction :: Module -> String -> IO (Maybe Value)
- getParams :: Value -> IO [Value]
- getFunctionCallConv :: Value -> IO CallingConvention
- setFunctionCallConv :: Value -> CallingConvention -> IO ()
- getInstructionCallConv :: Value -> IO CallingConvention
- setInstructionCallConv :: Value -> CallingConvention -> IO ()
- addAttribute :: Value -> Attribute -> IO ()
- removeAttribute :: Value -> Attribute -> IO ()
- addFunctionAttr :: Value -> Attribute -> IO ()
- setMetadata :: Value -> MetadataKind -> Value -> IO ()
- getMetadata :: Value -> MetadataKind -> IO Value
- getNamedMetadataOperands :: Module -> String -> IO [Value]
- addNamedMetadataOperand :: Module -> String -> Value -> IO ()
- mdNode :: [Value] -> IO Value
- mdString :: String -> Value
- type BasicBlock = BasicBlockRef
- appendBasicBlock :: Value -> String -> IO BasicBlock
- appendBasicBlockInContext :: Context -> Value -> String -> IO BasicBlock
- getBasicBlocks :: Value -> IO [BasicBlock]
- getNextBasicBlock :: BasicBlock -> IO (Maybe BasicBlock)
- type Builder = ForeignPtr Builder
- createBuilder :: IO Builder
- createBuilderInContext :: Context -> IO Builder
- getCurrentDebugLocation :: ForeignPtr Builder -> IO ValueRef
- setCurrentDebugLocation :: ForeignPtr Builder -> ValueRef -> IO ()
- setInstDebugLocation :: ForeignPtr Builder -> ValueRef -> IO ()
- getInsertBlock :: ForeignPtr Builder -> IO BasicBlockRef
- positionBuilder :: ForeignPtr Builder -> BasicBlockRef -> ValueRef -> IO ()
- positionBefore :: ForeignPtr Builder -> ValueRef -> IO ()
- positionAtEnd :: ForeignPtr Builder -> BasicBlockRef -> IO ()
- buildRetVoid :: ForeignPtr Builder -> IO ValueRef
- buildRet :: ForeignPtr Builder -> ValueRef -> IO ValueRef
- buildBr :: ForeignPtr Builder -> BasicBlockRef -> IO ValueRef
- buildIndirectBr :: ForeignPtr Builder -> ValueRef -> CUInt -> IO ValueRef
- buildCondBr :: ForeignPtr Builder -> ValueRef -> BasicBlockRef -> BasicBlockRef -> IO ValueRef
- buildSwitch :: ForeignPtr Builder -> ValueRef -> BasicBlockRef -> CUInt -> IO ValueRef
- buildUnreachable :: ForeignPtr Builder -> IO ValueRef
- buildAdd :: Builder -> Value -> Value -> String -> IO Value
- buildSub :: Builder -> Value -> Value -> String -> IO Value
- buildMul :: Builder -> Value -> Value -> String -> IO Value
- buildFAdd :: Builder -> Value -> Value -> String -> IO Value
- buildFMul :: Builder -> Value -> Value -> String -> IO Value
- buildFPCast :: Builder -> Value -> Type -> String -> IO Value
- buildFSub :: Builder -> Value -> Value -> String -> IO Value
- buildUDiv :: Builder -> Value -> Value -> String -> IO Value
- buildSDiv :: Builder -> Value -> Value -> String -> IO Value
- buildExactSDiv :: Builder -> Value -> Value -> String -> IO Value
- buildFDiv :: Builder -> Value -> Value -> String -> IO Value
- buildURem :: Builder -> Value -> Value -> String -> IO Value
- buildSRem :: Builder -> Value -> Value -> String -> IO Value
- buildFRem :: Builder -> Value -> Value -> String -> IO Value
- buildShl :: Builder -> Value -> Value -> String -> IO Value
- buildLShr :: Builder -> Value -> Value -> String -> IO Value
- buildAShr :: Builder -> Value -> Value -> String -> IO Value
- buildAnd :: Builder -> Value -> Value -> String -> IO Value
- buildOr :: Builder -> Value -> Value -> String -> IO Value
- buildXor :: Builder -> Value -> Value -> String -> IO Value
- buildNeg :: Builder -> Value -> String -> IO Value
- buildFNeg :: Builder -> Value -> String -> IO Value
- buildNot :: Builder -> Value -> String -> IO Value
- buildNSWAdd :: Builder -> Value -> Value -> String -> IO Value
- buildNSWMul :: Builder -> Value -> Value -> String -> IO Value
- buildNSWNeg :: Builder -> Value -> String -> IO Value
- buildNSWSub :: Builder -> Value -> Value -> String -> IO Value
- buildNUWAdd :: Builder -> Value -> Value -> String -> IO Value
- buildNUWMul :: Builder -> Value -> Value -> String -> IO Value
- buildNUWNeg :: Builder -> Value -> String -> IO Value
- buildNUWSub :: Builder -> Value -> Value -> String -> IO Value
- buildFCmp :: Builder -> FPPredicate -> Value -> Value -> String -> IO Value
- buildICmp :: Builder -> IntPredicate -> Value -> Value -> String -> IO Value
- buildAlloca :: Builder -> Type -> String -> IO Value
- buildLoad :: Builder -> Value -> String -> IO Value
- buildStructGEP :: Builder -> Value -> CUInt -> String -> IO Value
- buildInBoundsGEP :: Builder -> Value -> [Value] -> String -> IO Value
- constGEP :: Value -> [Value] -> IO Value
- buildStore :: ForeignPtr Builder -> ValueRef -> ValueRef -> IO ValueRef
- buildTrunc :: Builder -> Value -> Type -> String -> IO Value
- buildZExt :: Builder -> Value -> Type -> String -> IO Value
- buildSExt :: Builder -> Value -> Type -> String -> IO Value
- buildFPToUI :: Builder -> Value -> Type -> String -> IO Value
- buildFPToSI :: Builder -> Value -> Type -> String -> IO Value
- buildUIToFP :: Builder -> Value -> Type -> String -> IO Value
- buildSIToFP :: Builder -> Value -> Type -> String -> IO Value
- buildFPTrunc :: Builder -> Value -> Type -> String -> IO Value
- buildFPExt :: Builder -> Value -> Type -> String -> IO Value
- buildPtrToInt :: Builder -> Value -> Type -> String -> IO Value
- buildIntToPtr :: Builder -> Value -> Type -> String -> IO Value
- buildBitCast :: Builder -> Value -> Type -> String -> IO Value
- buildPointerCast :: Builder -> Value -> Type -> String -> IO Value
- buildTruncOrBitCast :: Builder -> Value -> Type -> String -> IO Value
- buildZExtOrBitCast :: Builder -> Value -> Type -> String -> IO Value
- buildSExtOrBitCast :: Builder -> Value -> Type -> String -> IO Value
- data CUInt
- data CULLong
- data CSize
- buildPhi :: Builder -> Type -> String -> IO Value
- addIncoming :: Value -> [(Value, BasicBlock)] -> IO ()
- buildCall :: Builder -> Value -> [Value] -> String -> IO Value
- buildSelect :: Builder -> Value -> Value -> Value -> String -> IO Value
- isUnreachable :: Value -> IO Bool
- dumpModuleToString :: Module -> IO String
- dumpValueToString :: Value -> IO String
- dumpTypeToString :: Type -> IO String
Documentation
module LLVM.FFI.Core
type Context = ForeignPtr ContextSource
createMemoryBufferWithMemoryRange :: Ptr a -> CSize -> String -> Bool -> IO MemoryBufferSource
createMemoryBufferWithMemoryRangeCopy :: Ptr a -> CSize -> String -> IO MemoryBufferSource
Modules
printModuleToFile :: Module -> FilePath -> IO ()Source
dumpModule :: Module -> IO ()Source
Types
voidTypeInContext :: Context -> IO TypeSource
Function types
Struct types
structType :: [Type] -> Bool -> TypeSource
structCreateNamed :: String -> IO TypeSource
Misc
Values
getValueName :: Value -> IO StringSource
setValueName :: Value -> String -> IO ()Source
getLinkage :: Value -> IO LinkageSource
setLinkage :: Value -> Linkage -> IO ()Source
Scalar constants
constRealOfString :: Type -> String -> ValueSource
constString :: String -> Bool -> ValueSource
Globals
Pass Manager
data PassManager Source
Instances
runPassManager :: PassManager -> Module -> IO BoolSource
runFunctionPassManager :: PassManager -> Value -> IO BoolSource
Functions
setFunctionCallConv :: Value -> CallingConvention -> IO ()Source
setInstructionCallConv :: Value -> CallingConvention -> IO ()Source
addAttribute :: Value -> Attribute -> IO ()Source
removeAttribute :: Value -> Attribute -> IO ()Source
addFunctionAttr :: Value -> Attribute -> IO ()Source
Metadata
setMetadata :: Value -> MetadataKind -> Value -> IO ()Source
getMetadata :: Value -> MetadataKind -> IO ValueSource
Basic blocks
type BasicBlock = BasicBlockRefSource
appendBasicBlock :: Value -> String -> IO BasicBlockSource
appendBasicBlockInContext :: Context -> Value -> String -> IO BasicBlockSource
getBasicBlocks :: Value -> IO [BasicBlock]Source
Instruction building
type Builder = ForeignPtr BuilderSource
setCurrentDebugLocation :: ForeignPtr Builder -> ValueRef -> IO ()Source
setInstDebugLocation :: ForeignPtr Builder -> ValueRef -> IO ()Source
positionBuilder :: ForeignPtr Builder -> BasicBlockRef -> ValueRef -> IO ()Source
positionBefore :: ForeignPtr Builder -> ValueRef -> IO ()Source
positionAtEnd :: ForeignPtr Builder -> BasicBlockRef -> IO ()Source
Control
buildBr :: ForeignPtr Builder -> BasicBlockRef -> IO ValueRefSource
buildIndirectBr :: ForeignPtr Builder -> ValueRef -> CUInt -> IO ValueRefSource
buildCondBr :: ForeignPtr Builder -> ValueRef -> BasicBlockRef -> BasicBlockRef -> IO ValueRefSource
buildSwitch :: ForeignPtr Builder -> ValueRef -> BasicBlockRef -> CUInt -> IO ValueRefSource
Arithmetic
Memory
buildStore :: ForeignPtr Builder -> ValueRef -> ValueRef -> IO ValueRefSource
Casts
Misc
data CUInt
Haskell type representing the C unsigned int
type.
data CULLong
Haskell type representing the C unsigned long long
type.
data CSize
Haskell type representing the C size_t
type.
addIncoming :: Value -> [(Value, BasicBlock)] -> IO ()Source
isUnreachable :: Value -> IO BoolSource
Debug
dumpValueToString :: Value -> IO StringSource
dumpTypeToString :: Type -> IO StringSource