rocm.bindings.llvm.c.cycore#
2026-09-24
76 min read time
Applies to Linux and Windows
Advanced Micro Devices, Inc.
Cython declarations for the C-level interface. Use
cimport rocm.bindings.llvm.c.cycore from your Cython code to access
these declarations directly.
See also
The high-level Python API is documented at rocm.bindings.llvm.c.core.
# MIT License
#
# Copyright (c) 2021-2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# This file has been autogenerated, do not modify.
from libc.stdint cimport *
ctypedef bint _Bool # bool is not a reserved keyword in C, _Bool is
from rocm.bindings.llvm.c.cydeprecated cimport *
from rocm.bindings.llvm.c.cyerrorhandling cimport *
from rocm.bindings.llvm.c.cyvisibility cimport *
from rocm.bindings.llvm.c.cytypes cimport *
cdef extern from "llvm-c/Core.h":
ctypedef enum LLVMOpcode:
LLVMRet
LLVMUncondBr
LLVMCondBr
LLVMSwitch
LLVMIndirectBr
LLVMInvoke
LLVMUnreachable
LLVMCallBr
LLVMFNeg
LLVMAdd
LLVMFAdd
LLVMSub
LLVMFSub
LLVMMul
LLVMFMul
LLVMUDiv
LLVMSDiv
LLVMFDiv
LLVMURem
LLVMSRem
LLVMFRem
LLVMShl
LLVMLShr
LLVMAShr
LLVMAnd
LLVMOr
LLVMXor
LLVMAlloca
LLVMLoad
LLVMStore
LLVMGetElementPtr
LLVMTrunc
LLVMZExt
LLVMSExt
LLVMFPToUI
LLVMFPToSI
LLVMUIToFP
LLVMSIToFP
LLVMFPTrunc
LLVMFPExt
LLVMPtrToInt
LLVMPtrToAddr
LLVMIntToPtr
LLVMBitCast
LLVMAddrSpaceCast
LLVMICmp
LLVMFCmp
LLVMPHI
LLVMCall
LLVMSelect
LLVMUserOp1
LLVMUserOp2
LLVMVAArg
LLVMExtractElement
LLVMInsertElement
LLVMShuffleVector
LLVMExtractValue
LLVMInsertValue
LLVMFreeze
LLVMFence
LLVMAtomicCmpXchg
LLVMAtomicRMW
LLVMResume
LLVMLandingPad
LLVMCleanupRet
LLVMCatchRet
LLVMCatchPad
LLVMCleanupPad
LLVMCatchSwitch
ctypedef enum LLVMTypeKind:
LLVMVoidTypeKind
LLVMHalfTypeKind
LLVMFloatTypeKind
LLVMDoubleTypeKind
LLVMX86_FP80TypeKind
LLVMFP128TypeKind
LLVMPPC_FP128TypeKind
LLVMLabelTypeKind
LLVMIntegerTypeKind
LLVMFunctionTypeKind
LLVMStructTypeKind
LLVMArrayTypeKind
LLVMPointerTypeKind
LLVMVectorTypeKind
LLVMMetadataTypeKind
LLVMTokenTypeKind
LLVMScalableVectorTypeKind
LLVMBFloatTypeKind
LLVMX86_AMXTypeKind
LLVMTargetExtTypeKind
LLVMByteTypeKind
ctypedef enum LLVMLinkage:
LLVMExternalLinkage
LLVMAvailableExternallyLinkage
LLVMLinkOnceAnyLinkage
LLVMLinkOnceODRLinkage
LLVMLinkOnceODRAutoHideLinkage
LLVMWeakAnyLinkage
LLVMWeakODRLinkage
LLVMAppendingLinkage
LLVMInternalLinkage
LLVMPrivateLinkage
LLVMDLLImportLinkage
LLVMDLLExportLinkage
LLVMExternalWeakLinkage
LLVMGhostLinkage
LLVMCommonLinkage
LLVMLinkerPrivateLinkage
LLVMLinkerPrivateWeakLinkage
ctypedef enum LLVMVisibility:
LLVMDefaultVisibility
LLVMHiddenVisibility
LLVMProtectedVisibility
ctypedef enum LLVMUnnamedAddr:
LLVMNoUnnamedAddr
LLVMLocalUnnamedAddr
LLVMGlobalUnnamedAddr
ctypedef enum LLVMDLLStorageClass:
LLVMDefaultStorageClass
LLVMDLLImportStorageClass
LLVMDLLExportStorageClass
ctypedef enum LLVMCallConv:
LLVMCCallConv
LLVMFastCallConv
LLVMColdCallConv
LLVMGHCCallConv
LLVMHiPECallConv
LLVMAnyRegCallConv
LLVMPreserveMostCallConv
LLVMPreserveAllCallConv
LLVMSwiftCallConv
LLVMCXXFASTTLSCallConv
LLVMX86StdcallCallConv
LLVMX86FastcallCallConv
LLVMARMAPCSCallConv
LLVMARMAAPCSCallConv
LLVMARMAAPCSVFPCallConv
LLVMMSP430INTRCallConv
LLVMX86ThisCallCallConv
LLVMPTXKernelCallConv
LLVMPTXDeviceCallConv
LLVMSPIRFUNCCallConv
LLVMSPIRKERNELCallConv
LLVMIntelOCLBICallConv
LLVMX8664SysVCallConv
LLVMWin64CallConv
LLVMX86VectorCallCallConv
LLVMHHVMCallConv
LLVMHHVMCCallConv
LLVMX86INTRCallConv
LLVMAVRINTRCallConv
LLVMAVRSIGNALCallConv
LLVMAVRBUILTINCallConv
LLVMAMDGPUVSCallConv
LLVMAMDGPUGSCallConv
LLVMAMDGPUPSCallConv
LLVMAMDGPUCSCallConv
LLVMAMDGPUKERNELCallConv
LLVMX86RegCallCallConv
LLVMAMDGPUHSCallConv
LLVMMSP430BUILTINCallConv
LLVMAMDGPULSCallConv
LLVMAMDGPUESCallConv
ctypedef enum LLVMValueKind:
LLVMArgumentValueKind
LLVMBasicBlockValueKind
LLVMMemoryUseValueKind
LLVMMemoryDefValueKind
LLVMMemoryPhiValueKind
LLVMFunctionValueKind
LLVMGlobalAliasValueKind
LLVMGlobalIFuncValueKind
LLVMGlobalVariableValueKind
LLVMBlockAddressValueKind
LLVMConstantExprValueKind
LLVMConstantArrayValueKind
LLVMConstantStructValueKind
LLVMConstantVectorValueKind
LLVMUndefValueValueKind
LLVMConstantAggregateZeroValueKind
LLVMConstantDataArrayValueKind
LLVMConstantDataVectorValueKind
LLVMConstantIntValueKind
LLVMConstantByteValueKind
LLVMConstantFPValueKind
LLVMConstantPointerNullValueKind
LLVMConstantTokenNoneValueKind
LLVMMetadataAsValueValueKind
LLVMInlineAsmValueKind
LLVMInstructionValueKind
LLVMPoisonValueValueKind
LLVMConstantTargetNoneValueKind
LLVMConstantPtrAuthValueKind
ctypedef enum LLVMIntPredicate:
LLVMIntEQ
LLVMIntNE
LLVMIntUGT
LLVMIntUGE
LLVMIntULT
LLVMIntULE
LLVMIntSGT
LLVMIntSGE
LLVMIntSLT
LLVMIntSLE
ctypedef enum LLVMRealPredicate:
LLVMRealPredicateFalse
LLVMRealOEQ
LLVMRealOGT
LLVMRealOGE
LLVMRealOLT
LLVMRealOLE
LLVMRealONE
LLVMRealORD
LLVMRealUNO
LLVMRealUEQ
LLVMRealUGT
LLVMRealUGE
LLVMRealULT
LLVMRealULE
LLVMRealUNE
LLVMRealPredicateTrue
ctypedef enum LLVMThreadLocalMode:
LLVMNotThreadLocal
LLVMGeneralDynamicTLSModel
LLVMLocalDynamicTLSModel
LLVMInitialExecTLSModel
LLVMLocalExecTLSModel
ctypedef enum LLVMAtomicOrdering:
LLVMAtomicOrderingNotAtomic
LLVMAtomicOrderingUnordered
LLVMAtomicOrderingMonotonic
LLVMAtomicOrderingAcquire
LLVMAtomicOrderingRelease
LLVMAtomicOrderingAcquireRelease
LLVMAtomicOrderingSequentiallyConsistent
ctypedef enum LLVMAtomicRMWBinOp:
LLVMAtomicRMWBinOpXchg
LLVMAtomicRMWBinOpAdd
LLVMAtomicRMWBinOpSub
LLVMAtomicRMWBinOpAnd
LLVMAtomicRMWBinOpNand
LLVMAtomicRMWBinOpOr
LLVMAtomicRMWBinOpXor
LLVMAtomicRMWBinOpMax
LLVMAtomicRMWBinOpMin
LLVMAtomicRMWBinOpUMax
LLVMAtomicRMWBinOpUMin
LLVMAtomicRMWBinOpFAdd
LLVMAtomicRMWBinOpFSub
LLVMAtomicRMWBinOpFMax
LLVMAtomicRMWBinOpFMin
LLVMAtomicRMWBinOpUIncWrap
LLVMAtomicRMWBinOpUDecWrap
LLVMAtomicRMWBinOpUSubCond
LLVMAtomicRMWBinOpUSubSat
LLVMAtomicRMWBinOpFMaximum
LLVMAtomicRMWBinOpFMinimum
LLVMAtomicRMWBinOpFMaximumNum
LLVMAtomicRMWBinOpFMinimumNum
ctypedef enum LLVMDiagnosticSeverity:
LLVMDSError
LLVMDSWarning
LLVMDSRemark
LLVMDSNote
ctypedef enum LLVMInlineAsmDialect:
LLVMInlineAsmDialectATT
LLVMInlineAsmDialectIntel
ctypedef enum LLVMModuleFlagBehavior:
LLVMModuleFlagBehaviorError
LLVMModuleFlagBehaviorWarning
LLVMModuleFlagBehaviorRequire
LLVMModuleFlagBehaviorOverride
LLVMModuleFlagBehaviorAppend
LLVMModuleFlagBehaviorAppendUnique
cdef enum:
LLVMAttributeReturnIndex
LLVMAttributeFunctionIndex
ctypedef unsigned int LLVMAttributeIndex
ctypedef enum LLVMTailCallKind:
LLVMTailCallKindNone
LLVMTailCallKindTail
LLVMTailCallKindMustTail
LLVMTailCallKindNoTail
cdef enum:
LLVMFastMathAllowReassoc
LLVMFastMathNoNaNs
LLVMFastMathNoInfs
LLVMFastMathNoSignedZeros
LLVMFastMathAllowReciprocal
LLVMFastMathAllowContract
LLVMFastMathApproxFunc
LLVMFastMathNone
LLVMFastMathAll
ctypedef unsigned int LLVMFastMathFlags
cdef enum:
LLVMGEPFlagInBounds
LLVMGEPFlagNUSW
LLVMGEPFlagNUW
ctypedef unsigned int LLVMGEPNoWrapFlags
ctypedef enum LLVMDbgRecordKind:
LLVMDbgRecordLabel
LLVMDbgRecordDeclare
LLVMDbgRecordValue
LLVMDbgRecordAssign
# Deallocate and destroy all ManagedStatic variables.
# @see llvm::llvm_shutdown
# @see ManagedStatic
cdef void LLVMShutdown()
#
# Return the major, minor, and patch version of LLVM
#
# The version components are returned via the function's three output
# parameters or skipped if a NULL pointer was supplied.
cdef void LLVMGetVersion(unsigned int * Major,unsigned int * Minor,unsigned int * Patch)
cdef char * LLVMCreateMessage(const char * Message)
cdef void LLVMDisposeMessage(char * Message)
cdef extern from "llvm-c/Core.h":
ctypedef void (*LLVMDiagnosticHandler) (LLVMDiagnosticInfoRef,void *)
ctypedef void (*LLVMYieldCallback) (LLVMContextRef,void *)
#
# Create a new context.
#
# Every call to this function should be paired with a call to
# LLVMContextDispose() or the context will leak memory.
cdef LLVMContextRef LLVMContextCreate()
#
# Obtain the global context instance.
cdef LLVMContextRef LLVMGetGlobalContext()
#
# Set the diagnostic handler for this context.
cdef void LLVMContextSetDiagnosticHandler(LLVMContextRef C,LLVMDiagnosticHandler Handler,void * DiagnosticContext)
#
# Get the diagnostic handler of this context.
cdef LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
#
# Get the diagnostic context of this context.
cdef void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
#
# Set the yield callback function for this context.
#
# @see LLVMContext::setYieldCallback()
cdef void LLVMContextSetYieldCallback(LLVMContextRef C,LLVMYieldCallback Callback,void * OpaqueHandle)
#
# Retrieve whether the given context is set to discard all value names.
#
# @see LLVMContext::shouldDiscardValueNames()
cdef int LLVMContextShouldDiscardValueNames(LLVMContextRef C)
#
# Set whether the given context discards all value names.
#
# If true, only the names of GlobalValue objects will be available in the IR.
# This can be used to save memory and runtime, especially in release mode.
#
# @see LLVMContext::setDiscardValueNames()
cdef void LLVMContextSetDiscardValueNames(LLVMContextRef C,int Discard)
#
# Destroy a context instance.
#
# This should be called for every call to LLVMContextCreate() or memory
# will be leaked.
cdef void LLVMContextDispose(LLVMContextRef C)
#
# Return a string representation of the DiagnosticInfo. Use
# LLVMDisposeMessage to free the string.
#
# @see DiagnosticInfo::print()
cdef char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
#
# Return an enum LLVMDiagnosticSeverity.
#
# @see DiagnosticInfo::getSeverity()
cdef LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
cdef unsigned int LLVMGetMDKindIDInContext(LLVMContextRef C,const char * Name,unsigned int SLen)
cdef unsigned int LLVMGetMDKindID(const char * Name,unsigned int SLen)
#
# Maps a synchronization scope name to a ID unique within this context.
cdef unsigned int LLVMGetSyncScopeID(LLVMContextRef C,const char * Name,size_t SLen)
#
# Return an unique id given the name of a enum attribute,
# or 0 if no attribute by that name exists.
#
# See http://llvm.org/docs/LangRef.html#parameter-attributes
# and http://llvm.org/docs/LangRef.html#function-attributes
# for the list of available attributes.
#
# NB: Attribute names and/or id are subject to change without
# going through the C API deprecation cycle.
cdef unsigned int LLVMGetEnumAttributeKindForName(const char * Name,size_t SLen)
cdef unsigned int LLVMGetLastEnumAttributeKind()
#
# Create an enum attribute.
cdef LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C,unsigned int KindID,uint64_t Val)
#
# Get the unique id corresponding to the enum attribute
# passed as argument.
cdef unsigned int LLVMGetEnumAttributeKind(LLVMAttributeRef A)
#
# Get the enum attribute's value. 0 is returned if none exists.
cdef uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
#
# Create a type attribute
cdef LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C,unsigned int KindID,LLVMTypeRef type_ref)
#
# Get the type attribute's value.
cdef LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
#
# Create a ConstantRange attribute.
#
# LowerWords and UpperWords need to be NumBits divided by 64 rounded up
# elements long.
cdef LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C,unsigned int KindID,unsigned int NumBits,const uint64_t * LowerWords,const uint64_t * UpperWords)
cdef extern from "llvm-c/Core.h":
ctypedef enum LLVMDenormalModeKind:
LLVMDenormalModeKindIEEE
LLVMDenormalModeKindPreserveSign
LLVMDenormalModeKindPositiveZero
LLVMDenormalModeKindDynamic
#
# Create a DenormalFPEnv attribute.
#
# \p DefaultModeOutput is the assumed denormal handling for the outputs of most
# floating-point types.
#
# \p DefaultModeInput is the assumed denormal handling for the inputs of most
# floating-point types.
#
# \p FloatModeOutput is the assumed denormal handling for the outputs of
# float. This should always be the same as as DefaultModeOutput for most
# targets.
#
# \p FloatModeInput is the assumed denormal handling for the inputs of
# float. This should always be the same as as DefaultModeInput for most
# targets.
#
cdef LLVMAttributeRef LLVMCreateDenormalFPEnvAttribute(LLVMContextRef C,LLVMDenormalModeKind DefaultModeOutput,LLVMDenormalModeKind DefaultModeInput,LLVMDenormalModeKind FloatModeOutput,LLVMDenormalModeKind FloatModeInput)
#
# Create a string attribute.
cdef LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,const char * K,unsigned int KLength,const char * V,unsigned int VLength)
#
# Get the string attribute's kind.
cdef const char * LLVMGetStringAttributeKind(LLVMAttributeRef A,unsigned int * Length)
#
# Get the string attribute's value.
cdef const char * LLVMGetStringAttributeValue(LLVMAttributeRef A,unsigned int * Length)
#
# Check for the different types of attributes.
cdef int LLVMIsEnumAttribute(LLVMAttributeRef A)
cdef int LLVMIsStringAttribute(LLVMAttributeRef A)
cdef int LLVMIsTypeAttribute(LLVMAttributeRef A)
#
# Obtain a Type from a context by its registered name.
cdef LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C,const char * Name)
#
# Create a new, empty module in the global context.
#
# This is equivalent to calling LLVMModuleCreateWithNameInContext with
# LLVMGetGlobalContext() as the context parameter.
#
# Every invocation should be paired with LLVMDisposeModule() or memory
# will be leaked.
cdef LLVMModuleRef LLVMModuleCreateWithName(const char * ModuleID)
#
# Create a new, empty module in a specific context.
#
# Every invocation should be paired with LLVMDisposeModule() or memory
# will be leaked.
cdef LLVMModuleRef LLVMModuleCreateWithNameInContext(const char * ModuleID,LLVMContextRef C)
#
# Return an exact copy of the specified module.
cdef LLVMModuleRef LLVMCloneModule(LLVMModuleRef M)
#
# Destroy a module instance.
#
# This must be called for every created module or memory will be
# leaked.
cdef void LLVMDisposeModule(LLVMModuleRef M)
#
# Soon to be deprecated.
# See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
#
# Returns true if the module is in the new debug info mode which uses
# non-instruction debug records instead of debug intrinsics for variable
# location tracking.
cdef int LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
#
# Soon to be deprecated.
# See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
#
# Convert module into desired debug info format.
cdef void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M,int UseNewFormat)
#
# Obtain the identifier of a module.
#
# @param M Module to obtain identifier of
# @param Len Out parameter which holds the length of the returned string.
# @return The identifier of M.
# @see Module::getModuleIdentifier()
cdef const char * LLVMGetModuleIdentifier(LLVMModuleRef M,size_t * Len)
#
# Set the identifier of a module to a string Ident with length Len.
#
# @param M The module to set identifier
# @param Ident The string to set M's identifier to
# @param Len Length of Ident
# @see Module::setModuleIdentifier()
cdef void LLVMSetModuleIdentifier(LLVMModuleRef M,const char * Ident,size_t Len)
#
# Obtain the module's original source file name.
#
# @param M Module to obtain the name of
# @param Len Out parameter which holds the length of the returned string
# @return The original source file name of M
# @see Module::getSourceFileName()
cdef const char * LLVMGetSourceFileName(LLVMModuleRef M,size_t * Len)
#
# Set the original source file name of a module to a string Name with length
# Len.
#
# @param M The module to set the source file name of
# @param Name The string to set M's source file name to
# @param Len Length of Name
# @see Module::setSourceFileName()
cdef void LLVMSetSourceFileName(LLVMModuleRef M,const char * Name,size_t Len)
#
# Obtain the data layout for a module.
#
# @see Module::getDataLayoutStr()
#
# LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
# but match the name of another method on the module. Prefer the use
# of LLVMGetDataLayoutStr, which is not ambiguous.
cdef const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
cdef const char * LLVMGetDataLayout(LLVMModuleRef M)
#
# Set the data layout for a module.
#
# @see Module::setDataLayout()
cdef void LLVMSetDataLayout(LLVMModuleRef M,const char * DataLayoutStr)
#
# Obtain the target triple for a module.
#
# @see Module::getTargetTriple()
cdef const char * LLVMGetTarget(LLVMModuleRef M)
#
# Set the target triple for a module.
#
# @see Module::setTargetTriple()
cdef void LLVMSetTarget(LLVMModuleRef M,const char * Triple)
#
# Returns the module flags as an array of flag-key-value triples. The caller
# is responsible for freeing this array by calling
# \c LLVMDisposeModuleFlagsMetadata.
#
# @see Module::getModuleFlagsMetadata()
cdef LLVMOpaqueModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M,size_t * Len)
#
# Destroys module flags metadata entries.
cdef void LLVMDisposeModuleFlagsMetadata(LLVMOpaqueModuleFlagEntry * Entries)
#
# Returns the flag behavior for a module flag entry at a specific index.
#
# @see Module::ModuleFlagEntry::Behavior
cdef LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMOpaqueModuleFlagEntry * Entries,unsigned int Index)
#
# Returns the key for a module flag entry at a specific index.
#
# @see Module::ModuleFlagEntry::Key
cdef const char * LLVMModuleFlagEntriesGetKey(LLVMOpaqueModuleFlagEntry * Entries,unsigned int Index,size_t * Len)
#
# Returns the metadata for a module flag entry at a specific index.
#
# @see Module::ModuleFlagEntry::Val
cdef LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMOpaqueModuleFlagEntry * Entries,unsigned int Index)
#
# Add a module-level flag to the module-level flags metadata if it doesn't
# already exist.
#
# @see Module::getModuleFlag()
cdef LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M,const char * Key,size_t KeyLen)
#
# Add a module-level flag to the module-level flags metadata if it doesn't
# already exist.
#
# @see Module::addModuleFlag()
cdef void LLVMAddModuleFlag(LLVMModuleRef M,LLVMModuleFlagBehavior Behavior,const char * Key,size_t KeyLen,LLVMMetadataRef Val)
#
# Dump a representation of a module to stderr.
#
# @see Module::dump()
cdef void LLVMDumpModule(LLVMModuleRef M)
#
# Print a representation of a module to a file. The ErrorMessage needs to be
# disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
#
# @see Module::print()
cdef int LLVMPrintModuleToFile(LLVMModuleRef M,const char * Filename,char ** ErrorMessage)
#
# Return a string representation of the module. Use
# LLVMDisposeMessage to free the string.
#
# @see Module::print()
cdef char * LLVMPrintModuleToString(LLVMModuleRef M)
#
# Get inline assembly for a module.
#
# @see Module::getModuleInlineAsm()
cdef const char * LLVMGetModuleInlineAsm(LLVMModuleRef M,size_t * Len)
#
# Set inline assembly for a module.
#
# @see Module::setModuleInlineAsm()
cdef void LLVMSetModuleInlineAsm2(LLVMModuleRef M,const char * Asm,size_t Len)
#
# Append inline assembly to a module.
#
# @see Module::appendModuleInlineAsm()
cdef void LLVMAppendModuleInlineAsm(LLVMModuleRef M,const char * Asm,size_t Len)
#
# Create the specified uniqued inline asm string.
#
# @see InlineAsm::get()
cdef LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty,const char * AsmString,size_t AsmStringSize,const char * Constraints,size_t ConstraintsSize,int HasSideEffects,int IsAlignStack,LLVMInlineAsmDialect Dialect,int CanThrow)
#
# Get the template string used for an inline assembly snippet
#
cdef const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal,size_t * Len)
#
# Get the raw constraint string for an inline assembly snippet
#
cdef const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal,size_t * Len)
#
# Get the dialect used by the inline asm snippet
#
cdef LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
#
# Get the function type of the inline assembly snippet. The same type that
# was passed into LLVMGetInlineAsm originally
#
# @see LLVMGetInlineAsm
#
cdef LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
#
# Get if the inline asm snippet has side effects
#
cdef int LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
#
# Get if the inline asm snippet needs an aligned stack
#
cdef int LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
#
# Get if the inline asm snippet may unwind the stack
#
cdef int LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
#
# Obtain the context to which this module is associated.
#
# @see Module::getContext()
cdef LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
# Deprecated: Use LLVMGetTypeByName2 instead.
cdef LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M,const char * Name)
#
# Obtain an iterator to the first NamedMDNode in a Module.
#
# @see llvm::Module::named_metadata_begin()
cdef LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
#
# Obtain an iterator to the last NamedMDNode in a Module.
#
# @see llvm::Module::named_metadata_end()
cdef LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
#
# Advance a NamedMDNode iterator to the next NamedMDNode.
#
# Returns NULL if the iterator was already at the end and there are no more
# named metadata nodes.
cdef LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
#
# Decrement a NamedMDNode iterator to the previous NamedMDNode.
#
# Returns NULL if the iterator was already at the beginning and there are
# no previous named metadata nodes.
cdef LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode)
#
# Retrieve a NamedMDNode with the given name, returning NULL if no such
# node exists.
#
# @see llvm::Module::getNamedMetadata()
cdef LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M,const char * Name,size_t NameLen)
#
# Retrieve a NamedMDNode with the given name, creating a new node if no such
# node exists.
#
# @see llvm::Module::getOrInsertNamedMetadata()
cdef LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M,const char * Name,size_t NameLen)
#
# Retrieve the name of a NamedMDNode.
#
# @see llvm::NamedMDNode::getName()
cdef const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD,size_t * NameLen)
#
# Obtain the number of operands for named metadata in a module.
#
# @see llvm::Module::getNamedMetadata()
cdef unsigned int LLVMGetNamedMetadataNumOperands(LLVMModuleRef M,const char * Name)
#
# Obtain the named metadata operands for a module.
#
# The passed LLVMValueRef pointer should refer to an array of
# LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
# array will be populated with the LLVMValueRef instances. Each
# instance corresponds to a llvm::MDNode.
#
# @see llvm::Module::getNamedMetadata()
# @see llvm::MDNode::getOperand()
cdef void LLVMGetNamedMetadataOperands(LLVMModuleRef M,const char * Name,LLVMValueRef * Dest)
#
# Add an operand to named metadata.
#
# @see llvm::Module::getNamedMetadata()
# @see llvm::MDNode::addOperand()
cdef void LLVMAddNamedMetadataOperand(LLVMModuleRef M,const char * Name,LLVMValueRef Val)
#
# Return the directory of the debug location for this value, which must be
# an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
#
# @see llvm::Instruction::getDebugLoc()
# @see llvm::GlobalVariable::getDebugInfo()
# @see llvm::Function::getSubprogram()
cdef const char * LLVMGetDebugLocDirectory(LLVMValueRef Val,unsigned int * Length)
#
# Return the filename of the debug location for this value, which must be
# an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
#
# @see llvm::Instruction::getDebugLoc()
# @see llvm::GlobalVariable::getDebugInfo()
# @see llvm::Function::getSubprogram()
cdef const char * LLVMGetDebugLocFilename(LLVMValueRef Val,unsigned int * Length)
#
# Return the line number of the debug location for this value, which must be
# an llvm::Instruction, llvm::GlobalVariable, or llvm::Function.
#
# @see llvm::Instruction::getDebugLoc()
# @see llvm::GlobalVariable::getDebugInfo()
# @see llvm::Function::getSubprogram()
cdef unsigned int LLVMGetDebugLocLine(LLVMValueRef Val)
#
# Return the column number of the debug location for this value, which must be
# an llvm::Instruction.
#
# @see llvm::Instruction::getDebugLoc()
cdef unsigned int LLVMGetDebugLocColumn(LLVMValueRef Val)
#
# Add a function to a module under a specified name.
#
# @see llvm::Function::Create()
cdef LLVMValueRef LLVMAddFunction(LLVMModuleRef M,const char * Name,LLVMTypeRef FunctionTy)
#
# Obtain or insert a function into a module.
#
# If a function with the specified name already exists in the module, it
# is returned. Otherwise, a new function is created in the module with the
# specified name and type and is returned.
#
# The returned value corresponds to a llvm::Function instance.
#
# @see llvm::Module::getOrInsertFunction()
cdef LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M,const char * Name,size_t NameLen,LLVMTypeRef FunctionTy)
#
# Obtain a Function value from a Module by its name.
#
# The returned value corresponds to a llvm::Function value.
#
# @see llvm::Module::getFunction()
cdef LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M,const char * Name)
#
# Obtain a Function value from a Module by its name.
#
# The returned value corresponds to a llvm::Function value.
#
# @see llvm::Module::getFunction()
cdef LLVMValueRef LLVMGetNamedFunctionWithLength(LLVMModuleRef M,const char * Name,size_t Length)
#
# Obtain an iterator to the first Function in a Module.
#
# @see llvm::Module::begin()
cdef LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
#
# Obtain an iterator to the last Function in a Module.
#
# @see llvm::Module::end()
cdef LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
#
# Advance a Function iterator to the next Function.
#
# Returns NULL if the iterator was already at the end and there are no more
# functions.
cdef LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
#
# Decrement a Function iterator to the previous Function.
#
# Returns NULL if the iterator was already at the beginning and there are
# no previous functions.
cdef LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
# Deprecated: Use LLVMSetModuleInlineAsm2 instead.
cdef void LLVMSetModuleInlineAsm(LLVMModuleRef M,const char * Asm)
#
# Obtain the enumerated type of a Type instance.
#
# @see llvm::Type:getTypeID()
cdef LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
#
# Whether the type has a known size.
#
# Things that don't have a size are abstract types, labels, and void.a
#
# @see llvm::Type::isSized()
cdef int LLVMTypeIsSized(LLVMTypeRef Ty)
#
# Obtain the context to which this type instance is associated.
#
# @see llvm::Type::getContext()
cdef LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
#
# Dump a representation of a type to stderr.
#
# @see llvm::Type::dump()
cdef void LLVMDumpType(LLVMTypeRef Val)
#
# Return a string representation of the type. Use
# LLVMDisposeMessage to free the string.
#
# @see llvm::Type::print()
cdef char * LLVMPrintTypeToString(LLVMTypeRef Val)
#
# Obtain a byte type from a context with specified bit width.
cdef LLVMTypeRef LLVMByteTypeInContext(LLVMContextRef C,unsigned int NumBits)
cdef unsigned int LLVMGetByteTypeWidth(LLVMTypeRef ByteTy)
#
# Obtain an integer type from a context with specified bit width.
cdef LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
cdef LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
cdef LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
cdef LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
cdef LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
cdef LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
cdef LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C,unsigned int NumBits)
#
# Obtain an integer type from the global context with a specified bit
# width.
cdef LLVMTypeRef LLVMInt1Type()
cdef LLVMTypeRef LLVMInt8Type()
cdef LLVMTypeRef LLVMInt16Type()
cdef LLVMTypeRef LLVMInt32Type()
cdef LLVMTypeRef LLVMInt64Type()
cdef LLVMTypeRef LLVMInt128Type()
cdef LLVMTypeRef LLVMIntType(unsigned int NumBits)
cdef unsigned int LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
#
# Obtain a 16-bit floating point type from a context.
cdef LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
#
# Obtain a 16-bit brain floating point type from a context.
cdef LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
#
# Obtain a 32-bit floating point type from a context.
cdef LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
#
# Obtain a 64-bit floating point type from a context.
cdef LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
#
# Obtain a 80-bit floating point type (X87) from a context.
cdef LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
#
# Obtain a 128-bit floating point type (112-bit mantissa) from a
# context.
cdef LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
#
# Obtain a 128-bit floating point type (two 64-bits) from a context.
cdef LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
#
# Obtain a floating point type from the global context.
#
# These map to the functions in this group of the same name.
cdef LLVMTypeRef LLVMHalfType()
cdef LLVMTypeRef LLVMBFloatType()
cdef LLVMTypeRef LLVMFloatType()
cdef LLVMTypeRef LLVMDoubleType()
cdef LLVMTypeRef LLVMX86FP80Type()
cdef LLVMTypeRef LLVMFP128Type()
cdef LLVMTypeRef LLVMPPCFP128Type()
#
# Obtain a function type consisting of a specified signature.
#
# The function is defined as a tuple of a return Type, a list of
# parameter types, and whether the function is variadic.
cdef LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,LLVMTypeRef * ParamTypes,unsigned int ParamCount,int IsVarArg)
#
# Returns whether a function type is variadic.
cdef int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
#
# Obtain the Type this function Type returns.
cdef LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
#
# Obtain the number of parameters this function accepts.
cdef unsigned int LLVMCountParamTypes(LLVMTypeRef FunctionTy)
#
# Obtain the types of a function's parameters.
#
# The Dest parameter should point to a pre-allocated array of
# LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
# first LLVMCountParamTypes() entries in the array will be populated
# with LLVMTypeRef instances.
#
# @param FunctionTy The function type to operate on.
# @param Dest Memory address of an array to be filled with result.
cdef void LLVMGetParamTypes(LLVMTypeRef FunctionTy,LLVMTypeRef * Dest)
#
# Create a new structure type in a context.
#
# A structure is specified by a list of inner elements/types and
# whether these can be packed together.
#
# @see llvm::StructType::create()
cdef LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C,LLVMTypeRef * ElementTypes,unsigned int ElementCount,int Packed)
#
# Create a new structure type in the global context.
#
# @see llvm::StructType::create()
cdef LLVMTypeRef LLVMStructType(LLVMTypeRef * ElementTypes,unsigned int ElementCount,int Packed)
#
# Create an empty structure in a context having a specified name.
#
# @see llvm::StructType::create()
cdef LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C,const char * Name)
#
# Obtain the name of a structure.
#
# @see llvm::StructType::getName()
cdef const char * LLVMGetStructName(LLVMTypeRef Ty)
#
# Set the contents of a structure type.
#
# @see llvm::StructType::setBody()
cdef void LLVMStructSetBody(LLVMTypeRef StructTy,LLVMTypeRef * ElementTypes,unsigned int ElementCount,int Packed)
#
# Get the number of elements defined inside the structure.
#
# @see llvm::StructType::getNumElements()
cdef unsigned int LLVMCountStructElementTypes(LLVMTypeRef StructTy)
#
# Get the elements within a structure.
#
# The function is passed the address of a pre-allocated array of
# LLVMTypeRef at least LLVMCountStructElementTypes() long. After
# invocation, this array will be populated with the structure's
# elements. The objects in the destination array will have a lifetime
# of the structure type itself, which is the lifetime of the context it
# is contained in.
cdef void LLVMGetStructElementTypes(LLVMTypeRef StructTy,LLVMTypeRef * Dest)
#
# Get the type of the element at a given index in the structure.
#
# @see llvm::StructType::getTypeAtIndex()
cdef LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy,unsigned int i)
#
# Determine whether a structure is packed.
#
# @see llvm::StructType::isPacked()
cdef int LLVMIsPackedStruct(LLVMTypeRef StructTy)
#
# Determine whether a structure is opaque.
#
# @see llvm::StructType::isOpaque()
cdef int LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
#
# Determine whether a structure is literal.
#
# @see llvm::StructType::isLiteral()
cdef int LLVMIsLiteralStruct(LLVMTypeRef StructTy)
#
# Obtain the element type of an array or vector type.
#
# @see llvm::SequentialType::getElementType()
cdef LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty)
#
# Returns type's subtypes
#
# @see llvm::Type::subtypes()
cdef void LLVMGetSubtypes(LLVMTypeRef Tp,LLVMTypeRef * Arr)
#
# Return the number of types in the derived type.
#
# @see llvm::Type::getNumContainedTypes()
cdef unsigned int LLVMGetNumContainedTypes(LLVMTypeRef Tp)
#
# Create a fixed size array type that refers to a specific type.
#
# The created type will exist in the context that its element type
# exists in.
#
# @deprecated LLVMArrayType is deprecated in favor of the API accurate
# LLVMArrayType2
# @see llvm::ArrayType::get()
cdef LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType,unsigned int ElementCount)
#
# Create a fixed size array type that refers to a specific type.
#
# The created type will exist in the context that its element type
# exists in.
#
# @see llvm::ArrayType::get()
cdef LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType,uint64_t ElementCount)
#
# Obtain the length of an array type.
#
# This only works on types that represent arrays.
#
# @deprecated LLVMGetArrayLength is deprecated in favor of the API accurate
# LLVMGetArrayLength2
# @see llvm::ArrayType::getNumElements()
cdef unsigned int LLVMGetArrayLength(LLVMTypeRef ArrayTy)
#
# Obtain the length of an array type.
#
# This only works on types that represent arrays.
#
# @see llvm::ArrayType::getNumElements()
cdef uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
#
# Create a pointer type that points to a defined type.
#
# The created type will exist in the context that its pointee type
# exists in.
#
# @see llvm::PointerType::get()
cdef LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType,unsigned int AddressSpace)
#
# Determine whether a pointer is opaque.
#
# True if this is an instance of an opaque PointerType.
#
# @see llvm::Type::isOpaquePointerTy()
cdef int LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
#
# Create an opaque pointer type in a context.
#
# @see llvm::PointerType::get()
cdef LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C,unsigned int AddressSpace)
#
# Obtain the address space of a pointer type.
#
# This only works on types that represent pointers.
#
# @see llvm::PointerType::getAddressSpace()
cdef unsigned int LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
#
# Create a vector type that contains a defined type and has a specific
# number of elements.
#
# The created type will exist in the context thats its element type
# exists in.
#
# @see llvm::VectorType::get()
cdef LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType,unsigned int ElementCount)
#
# Create a vector type that contains a defined type and has a scalable
# number of elements.
#
# The created type will exist in the context thats its element type
# exists in.
#
# @see llvm::ScalableVectorType::get()
cdef LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,unsigned int ElementCount)
#
# Obtain the (possibly scalable) number of elements in a vector type.
#
# This only works on types that represent vectors (fixed or scalable).
#
# @see llvm::VectorType::getNumElements()
cdef unsigned int LLVMGetVectorSize(LLVMTypeRef VectorTy)
#
# Get the pointer value for the associated ConstantPtrAuth constant.
#
# @see llvm::ConstantPtrAuth::getPointer
cdef LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
#
# Get the key value for the associated ConstantPtrAuth constant.
#
# @see llvm::ConstantPtrAuth::getKey
cdef LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
#
# Get the discriminator value for the associated ConstantPtrAuth constant.
#
# @see llvm::ConstantPtrAuth::getDiscriminator
cdef LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
#
# Get the address discriminator value for the associated ConstantPtrAuth
# constant.
#
# @see llvm::ConstantPtrAuth::getAddrDiscriminator
cdef LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
#
# Create a void type in a context.
cdef LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
#
# Create a label type in a context.
cdef LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
#
# Create a X86 AMX type in a context.
cdef LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
#
# Create a token type in a context.
cdef LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
#
# Create a metadata type in a context.
cdef LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
#
# These are similar to the above functions except they operate on the
# global context.
cdef LLVMTypeRef LLVMVoidType()
cdef LLVMTypeRef LLVMLabelType()
cdef LLVMTypeRef LLVMX86AMXType()
#
# Create a target extension type in LLVM context.
cdef LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C,const char * Name,LLVMTypeRef * TypeParams,unsigned int TypeParamCount,unsigned int * IntParams,unsigned int IntParamCount)
#
# Obtain the name for this target extension type.
#
# @see llvm::TargetExtType::getName()
cdef const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
#
# Obtain the number of type parameters for this target extension type.
#
# @see llvm::TargetExtType::getNumTypeParameters()
cdef unsigned int LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
#
# Get the type parameter at the given index for the target extension type.
#
# @see llvm::TargetExtType::getTypeParameter()
cdef LLVMTypeRef LLVMGetTargetExtTypeTypeParam(LLVMTypeRef TargetExtTy,unsigned int Idx)
#
# Obtain the number of int parameters for this target extension type.
#
# @see llvm::TargetExtType::getNumIntParameters()
cdef unsigned int LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
#
# Get the int parameter at the given index for the target extension type.
#
# @see llvm::TargetExtType::getIntParameter()
cdef unsigned int LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy,unsigned int Idx)
#
# Obtain the type of a value.
#
# @see llvm::Value::getType()
cdef LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
#
# Obtain the enumerated type of a Value instance.
#
# @see llvm::Value::getValueID()
cdef LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
#
# Obtain the string name of a value.
#
# @see llvm::Value::getName()
cdef const char * LLVMGetValueName2(LLVMValueRef Val,size_t * Length)
#
# Set the string name of a value.
#
# @see llvm::Value::setName()
cdef void LLVMSetValueName2(LLVMValueRef Val,const char * Name,size_t NameLen)
#
# Dump a representation of a value to stderr.
#
# @see llvm::Value::dump()
cdef void LLVMDumpValue(LLVMValueRef Val)
#
# Return a string representation of the value. Use
# LLVMDisposeMessage to free the string.
#
# @see llvm::Value::print()
cdef char * LLVMPrintValueToString(LLVMValueRef Val)
#
# Obtain the context to which this value is associated.
#
# @see llvm::Value::getContext()
cdef LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
#
# Return a string representation of the DbgRecord. Use
# LLVMDisposeMessage to free the string.
#
# @see llvm::DbgRecord::print()
cdef char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
#
# Replace all uses of a value with another one.
#
# @see llvm::Value::replaceAllUsesWith()
cdef void LLVMReplaceAllUsesWith(LLVMValueRef OldVal,LLVMValueRef NewVal)
#
# Determine whether the specified value instance is constant.
cdef int LLVMIsConstant(LLVMValueRef Val)
#
# Determine whether a value instance is undefined.
cdef int LLVMIsUndef(LLVMValueRef Val)
#
# Determine whether a value instance is poisonous.
cdef int LLVMIsPoison(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAArgument(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsABasicBlock(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAInlineAsm(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUser(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstant(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsABlockAddress(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantAggregateZero(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantArray(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantDataSequential(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantDataArray(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantDataVector(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantExpr(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantFP(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantInt(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantByte(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantPointerNull(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantStruct(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantTokenNone(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantVector(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAConstantPtrAuth(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAGlobalValue(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAGlobalAlias(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAGlobalObject(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFunction(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAGlobalVariable(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAGlobalIFunc(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUndefValue(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAPoisonValue(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAInstruction(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUnaryOperator(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsABinaryOperator(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACallInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAIntrinsicInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsADbgInfoIntrinsic(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsADbgVariableIntrinsic(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsADbgDeclareInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsADbgLabelInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAMemIntrinsic(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAMemCpyInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAMemMoveInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAMemSetInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACmpInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFCmpInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAICmpInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAExtractElementInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAGetElementPtrInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAInsertElementInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAInsertValueInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsALandingPadInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAPHINode(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsASelectInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAShuffleVectorInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAStoreInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUncondBrInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACondBrInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAIndirectBrInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAInvokeInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAReturnInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsASwitchInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUnreachableInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAResumeInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACleanupReturnInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACatchReturnInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACatchSwitchInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACallBrInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFuncletPadInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACatchPadInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACleanupPadInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUnaryInstruction(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAAllocaInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsACastInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAAddrSpaceCastInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsABitCastInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFPExtInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFPToSIInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFPToUIInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFPTruncInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAIntToPtrInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAPtrToIntInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsASExtInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsASIToFPInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsATruncInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAUIToFPInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAZExtInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAExtractValueInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsALoadInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAVAArgInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFreezeInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAAtomicCmpXchgInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAAtomicRMWInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAFenceInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsABranchInst(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
cdef LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
# Deprecated: Use LLVMGetValueName2 instead.
cdef const char * LLVMGetValueName(LLVMValueRef Val)
# Deprecated: Use LLVMSetValueName2 instead.
cdef void LLVMSetValueName(LLVMValueRef Val,const char * Name)
#
# Obtain the first use of a value.
#
# Uses are obtained in an iterator fashion. First, call this function
# to obtain a reference to the first use. Then, call LLVMGetNextUse()
# on that instance and all subsequently obtained instances until
# LLVMGetNextUse() returns NULL.
#
# @see llvm::Value::use_begin()
cdef LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
#
# Obtain the next use of a value.
#
# This effectively advances the iterator. It returns NULL if you are on
# the final use and no more are available.
cdef LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
#
# Obtain the user value for a user.
#
# The returned value corresponds to a llvm::User type.
#
# @see llvm::Use::getUser()
cdef LLVMValueRef LLVMGetUser(LLVMUseRef U)
#
# Obtain the value this use corresponds to.
#
# @see llvm::Use::get().
cdef LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
#
# Obtain an operand at a specific index in a llvm::User value.
#
# @see llvm::User::getOperand()
cdef LLVMValueRef LLVMGetOperand(LLVMValueRef Val,unsigned int Index)
#
# Obtain the use of an operand at a specific index in a llvm::User value.
#
# @see llvm::User::getOperandUse()
cdef LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val,unsigned int Index)
#
# Set an operand at a specific index in a llvm::User value.
#
# @see llvm::User::setOperand()
cdef void LLVMSetOperand(LLVMValueRef User,unsigned int Index,LLVMValueRef Val)
#
# Obtain the number of operands in a llvm::User value.
#
# @see llvm::User::getNumOperands()
cdef int LLVMGetNumOperands(LLVMValueRef Val)
#
# Obtain a constant value referring to the null instance of a type.
#
# @see llvm::Constant::getNullValue()
cdef LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
#
# Obtain a constant value referring to the instance of a type
# consisting of all ones.
#
# This is only valid for integer types.
#
# @see llvm::Constant::getAllOnesValue()
cdef LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
#
# Obtain a constant value referring to an undefined value of a type.
#
# @see llvm::UndefValue::get()
cdef LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
#
# Obtain a constant value referring to a poison value of a type.
#
# @see llvm::PoisonValue::get()
cdef LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
#
# Determine whether a value instance is null.
#
# @see llvm::Constant::isNullValue()
cdef int LLVMIsNull(LLVMValueRef Val)
#
# Obtain a constant that is a constant pointer pointing to NULL for a
# specified type.
cdef LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
#
# Obtain a constant value for an integer type.
#
# The returned value corresponds to a llvm::ConstantInt.
#
# @see llvm::ConstantInt::get()
#
# @param IntTy Integer type to obtain value of.
# @param N The value the returned instance should refer to.
# @param SignExtend Whether to sign extend the produced value.
cdef LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy,unsigned long long N,int SignExtend)
#
# Obtain a constant value for an integer of arbitrary precision.
#
# @see llvm::ConstantInt::get()
cdef LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy,unsigned int NumWords,const uint64_t * Words)
#
# Obtain a constant value for an integer parsed from a string.
#
# A similar API, LLVMConstIntOfStringAndSize is also available. If the
# string's length is available, it is preferred to call that function
# instead.
#
# @see llvm::ConstantInt::get()
cdef LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy,const char * Text,uint8_t Radix)
#
# Obtain a constant value for an integer parsed from a string with
# specified length.
#
# @see llvm::ConstantInt::get()
cdef LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy,const char * Text,unsigned int SLen,uint8_t Radix)
#
# Obtain a constant value for a byte type.
#
# The returned value corresponds to a llvm::ConstantByte.
#
# @see llvm::ConstantByte::get()
#
# @param ByteTy Byte type to obtain value of.
# @param N The value the returned instance should refer to.
cdef LLVMValueRef LLVMConstByte(LLVMTypeRef ByteTy,unsigned long long N)
#
# Obtain a constant value for a byte of arbitrary precision.
#
# @see llvm::ConstantByte::get()
cdef LLVMValueRef LLVMConstByteOfArbitraryPrecision(LLVMTypeRef ByteTy,unsigned int NumWords,const uint64_t * Words)
#
# Obtain a constant value for a byte parsed from a string with specified
# length.
# @see llvm::ConstantByte::get()
cdef LLVMValueRef LLVMConstByteOfStringAndSize(LLVMTypeRef ByteTy,const char * Text,size_t SLen,uint8_t Radix)
#
# Obtain a constant value referring to a double floating point value.
cdef LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy,double N)
#
# Obtain a constant for a floating point value parsed from a string.
#
# A similar API, LLVMConstRealOfStringAndSize is also available. It
# should be used if the input string's length is known.
cdef LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy,const char * Text)
#
# Obtain a constant for a floating point value parsed from a string.
cdef LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy,const char * Text,unsigned int SLen)
#
# Obtain a constant for a floating point value from array of 64 bit values.
# The length of the array N must be ceildiv(bits, 64), where bits is the
# scalar size in bits of the floating-point type.
cdef LLVMValueRef LLVMConstFPFromBits(LLVMTypeRef Ty,const uint64_t * N)
#
# Obtain the zero extended value for an integer constant value.
#
# @see llvm::ConstantInt::getZExtValue()
cdef unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
#
# Obtain the sign extended value for an integer constant value.
#
# @see llvm::ConstantInt::getSExtValue()
cdef long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
#
# Obtain the zero extended value for a byte constant value.
#
# @see llvm::ConstantByte::getZExtValue()
cdef unsigned long long LLVMConstByteGetZExtValue(LLVMValueRef ConstantVal)
#
# Obtain the sign extended value for a byte constant value.
#
# @see llvm::ConstantByte::getSExtValue()
cdef long long LLVMConstByteGetSExtValue(LLVMValueRef ConstantVal)
#
# Obtain the double value for an floating point constant value.
# losesInfo indicates if some precision was lost in the conversion.
#
# @see llvm::ConstantFP::getDoubleValue
cdef double LLVMConstRealGetDouble(LLVMValueRef ConstantVal,int * losesInfo)
#
# Create a ConstantDataSequential and initialize it with a string.
#
# @deprecated LLVMConstStringInContext is deprecated in favor of the API
# accurate LLVMConstStringInContext2
# @see llvm::ConstantDataArray::getString()
cdef LLVMValueRef LLVMConstStringInContext(LLVMContextRef C,const char * Str,unsigned int Length,int DontNullTerminate)
#
# Create a ConstantDataSequential and initialize it with a string.
#
# @see llvm::ConstantDataArray::getString()
cdef LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C,const char * Str,size_t Length,int DontNullTerminate)
#
# Create a ConstantDataSequential with string content in the global context.
#
# This is the same as LLVMConstStringInContext except it operates on the
# global context.
#
# @see LLVMConstStringInContext()
# @see llvm::ConstantDataArray::getString()
cdef LLVMValueRef LLVMConstString(const char * Str,unsigned int Length,int DontNullTerminate)
#
# Returns true if the specified constant is an array of i8.
#
# @see ConstantDataSequential::getAsString()
cdef int LLVMIsConstantString(LLVMValueRef c)
#
# Get the given constant data sequential as a string.
#
# @see ConstantDataSequential::getAsString()
cdef const char * LLVMGetAsString(LLVMValueRef c,size_t * Length)
#
# Get the raw, underlying bytes of the given constant data sequential.
#
# This is the same as LLVMGetAsString except it works for all constant data
# sequentials, not just i8 arrays.
#
# @see ConstantDataSequential::getRawDataValues()
cdef const char * LLVMGetRawDataValues(LLVMValueRef c,size_t * SizeInBytes)
#
# Create an anonymous ConstantStruct with the specified values.
#
# @see llvm::ConstantStruct::getAnon()
cdef LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,LLVMValueRef * ConstantVals,unsigned int Count,int Packed)
#
# Create a ConstantStruct in the global Context.
#
# This is the same as LLVMConstStructInContext except it operates on the
# global Context.
#
# @see LLVMConstStructInContext()
cdef LLVMValueRef LLVMConstStruct(LLVMValueRef * ConstantVals,unsigned int Count,int Packed)
#
# Create a ConstantArray from values.
#
# @deprecated LLVMConstArray is deprecated in favor of the API accurate
# LLVMConstArray2
# @see llvm::ConstantArray::get()
cdef LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,LLVMValueRef * ConstantVals,unsigned int Length)
#
# Create a ConstantArray from values.
#
# @see llvm::ConstantArray::get()
cdef LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy,LLVMValueRef * ConstantVals,uint64_t Length)
#
# Create a ConstantDataArray from raw values.
#
# ElementTy must be one of i8, i16, i32, i64, half, bfloat, float, or double.
# Data points to a contiguous buffer of raw values in the host endianness. The
# element count is inferred from the element type and the data size in bytes.
#
# @see llvm::ConstantDataArray::getRaw()
cdef LLVMValueRef LLVMConstDataArray(LLVMTypeRef ElementTy,const char * Data,size_t SizeInBytes)
#
# Create a non-anonymous ConstantStruct from values.
#
# @see llvm::ConstantStruct::get()
cdef LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,LLVMValueRef * ConstantVals,unsigned int Count)
#
# Get element of a constant aggregate (struct, array or vector) at the
# specified index. Returns null if the index is out of range, or it's not
# possible to determine the element (e.g., because the constant is a
# constant expression.)
#
# @see llvm::Constant::getAggregateElement()
cdef LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C,unsigned int Idx)
#
# Get an element at specified index as a constant.
#
# @see ConstantDataSequential::getElementAsConstant()
cdef LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C,unsigned int idx)
#
# Create a ConstantVector from values.
#
# @see llvm::ConstantVector::get()
cdef LLVMValueRef LLVMConstVector(LLVMValueRef * ScalarConstantVals,unsigned int Size)
#
# Create a ConstantPtrAuth constant with the given values.
#
# @see llvm::ConstantPtrAuth::get()
cdef LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr,LLVMValueRef Key,LLVMValueRef Disc,LLVMValueRef AddrDisc)
#
# @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
#
# Functions in this group correspond to APIs on llvm::ConstantExpr.
#
# @see llvm::ConstantExpr.
#
cdef LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
cdef LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
cdef LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
cdef LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
cdef LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
cdef LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
cdef LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
cdef LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant,LLVMValueRef RHSConstant)
cdef LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty,LLVMValueRef ConstantVal,LLVMValueRef * ConstantIndices,unsigned int NumIndices)
cdef LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty,LLVMValueRef ConstantVal,LLVMValueRef * ConstantIndices,unsigned int NumIndices)
#
# Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but
# allows specifying the no-wrap flags.
#
# @see llvm::ConstantExpr::getGetElementPtr()
cdef LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty,LLVMValueRef ConstantVal,LLVMValueRef * ConstantIndices,unsigned int NumIndices,unsigned int NoWrapFlags)
cdef LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,LLVMTypeRef ToType)
cdef LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,LLVMValueRef IndexConstant)
cdef LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,LLVMValueRef ElementValueConstant,LLVMValueRef IndexConstant)
cdef LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,LLVMValueRef VectorBConstant,LLVMValueRef MaskConstant)
cdef LLVMValueRef LLVMBlockAddress(LLVMValueRef F,LLVMBasicBlockRef BB)
#
# Gets the function associated with a given BlockAddress constant value.
cdef LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
#
# Gets the basic block associated with a given BlockAddress constant value.
cdef LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
# Deprecated: Use LLVMGetInlineAsm instead.
cdef LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty,const char * AsmString,const char * Constraints,int HasSideEffects,int IsAlignStack)
#
# @defgroup LLVMCCoreValueConstantGlobals Global Values
#
# This group contains functions that operate on global values. Functions in
# this group relate to functions in the llvm::GlobalValue class tree.
#
# @see llvm::GlobalValue
#
cdef LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
cdef int LLVMIsDeclaration(LLVMValueRef Global)
cdef LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
cdef void LLVMSetLinkage(LLVMValueRef Global,LLVMLinkage Linkage)
cdef const char * LLVMGetSection(LLVMValueRef Global)
cdef void LLVMSetSection(LLVMValueRef Global,const char * Section)
cdef LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
cdef void LLVMSetVisibility(LLVMValueRef Global,LLVMVisibility Viz)
cdef LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
cdef void LLVMSetDLLStorageClass(LLVMValueRef Global,LLVMDLLStorageClass Class)
cdef LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
cdef void LLVMSetUnnamedAddress(LLVMValueRef Global,LLVMUnnamedAddr UnnamedAddr)
#
# Returns the "value type" of a global value. This differs from the formal
# type of a global value which is always a pointer type.
#
# @see llvm::GlobalValue::getValueType()
# @see llvm::Function::getFunctionType()
cdef LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
# Deprecated: Use LLVMGetUnnamedAddress instead.
cdef int LLVMHasUnnamedAddr(LLVMValueRef Global)
# Deprecated: Use LLVMSetUnnamedAddress instead.
cdef void LLVMSetUnnamedAddr(LLVMValueRef Global,int HasUnnamedAddr)
#
# Obtain the preferred alignment of the value.
# @see llvm::AllocaInst::getAlignment()
# @see llvm::LoadInst::getAlignment()
# @see llvm::StoreInst::getAlignment()
# @see llvm::AtomicRMWInst::setAlignment()
# @see llvm::AtomicCmpXchgInst::setAlignment()
# @see llvm::GlobalValue::getAlignment()
cdef unsigned int LLVMGetAlignment(LLVMValueRef V)
#
# Set the preferred alignment of the value.
# @see llvm::AllocaInst::setAlignment()
# @see llvm::LoadInst::setAlignment()
# @see llvm::StoreInst::setAlignment()
# @see llvm::AtomicRMWInst::setAlignment()
# @see llvm::AtomicCmpXchgInst::setAlignment()
# @see llvm::GlobalValue::setAlignment()
cdef void LLVMSetAlignment(LLVMValueRef V,unsigned int Bytes)
#
# Sets a metadata attachment, erasing the existing metadata attachment if
# it already exists for the given kind.
#
# @see llvm::GlobalObject::setMetadata()
cdef void LLVMGlobalSetMetadata(LLVMValueRef Global,unsigned int Kind,LLVMMetadataRef MD)
#
# Adds a metadata attachment.
#
# @see llvm::GlobalObject::addMetadata()
cdef void LLVMGlobalAddMetadata(LLVMValueRef Global,unsigned int Kind,LLVMMetadataRef MD)
#
# Erases a metadata attachment of the given kind if it exists.
#
# @see llvm::GlobalObject::eraseMetadata()
cdef void LLVMGlobalEraseMetadata(LLVMValueRef Global,unsigned int Kind)
#
# Removes all metadata attachments from this value.
#
# @see llvm::GlobalObject::clearMetadata()
cdef void LLVMGlobalClearMetadata(LLVMValueRef Global)
#
# Add debuginfo metadata to this global.
#
# @see llvm::GlobalVariable::addDebugInfo()
cdef void LLVMGlobalAddDebugInfo(LLVMValueRef Global,LLVMMetadataRef GVE)
#
# Retrieves an array of metadata entries representing the metadata attached to
# this value. The caller is responsible for freeing this array by calling
# \c LLVMDisposeValueMetadataEntries.
#
# @see llvm::GlobalObject::getAllMetadata()
cdef LLVMOpaqueValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value,size_t * NumEntries)
#
# Destroys value metadata entries.
cdef void LLVMDisposeValueMetadataEntries(LLVMOpaqueValueMetadataEntry * Entries)
#
# Returns the kind of a value metadata entry at a specific index.
cdef unsigned int LLVMValueMetadataEntriesGetKind(LLVMOpaqueValueMetadataEntry * Entries,unsigned int Index)
#
# Returns the underlying metadata node of a value metadata entry at a
# specific index.
cdef LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMOpaqueValueMetadataEntry * Entries,unsigned int Index)
#
# @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
#
# This group contains functions that operate on global variable values.
#
# @see llvm::GlobalVariable
#
cdef LLVMValueRef LLVMAddGlobal(LLVMModuleRef M,LLVMTypeRef Ty,const char * Name)
cdef LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M,LLVMTypeRef Ty,const char * Name,unsigned int AddressSpace)
cdef LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M,const char * Name)
cdef LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M,const char * Name,size_t Length)
cdef LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
cdef LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
cdef LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
cdef LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
cdef void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
cdef LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
cdef void LLVMSetInitializer(LLVMValueRef GlobalVar,LLVMValueRef ConstantVal)
cdef int LLVMIsThreadLocal(LLVMValueRef GlobalVar)
cdef void LLVMSetThreadLocal(LLVMValueRef GlobalVar,int IsThreadLocal)
cdef int LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
cdef void LLVMSetGlobalConstant(LLVMValueRef GlobalVar,int IsConstant)
cdef LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
cdef void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar,LLVMThreadLocalMode Mode)
cdef int LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
cdef void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar,int IsExtInit)
#
# Add a GlobalAlias with the given value type, address space and aliasee.
#
# @see llvm::GlobalAlias::create()
cdef LLVMValueRef LLVMAddAlias2(LLVMModuleRef M,LLVMTypeRef ValueTy,unsigned int AddrSpace,LLVMValueRef Aliasee,const char * Name)
#
# Obtain a GlobalAlias value from a Module by its name.
#
# The returned value corresponds to a llvm::GlobalAlias value.
#
# @see llvm::Module::getNamedAlias()
cdef LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M,const char * Name,size_t NameLen)
#
# Obtain an iterator to the first GlobalAlias in a Module.
#
# @see llvm::Module::alias_begin()
cdef LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
#
# Obtain an iterator to the last GlobalAlias in a Module.
#
# @see llvm::Module::alias_end()
cdef LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
#
# Advance a GlobalAlias iterator to the next GlobalAlias.
#
# Returns NULL if the iterator was already at the end and there are no more
# global aliases.
cdef LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
#
# Decrement a GlobalAlias iterator to the previous GlobalAlias.
#
# Returns NULL if the iterator was already at the beginning and there are
# no previous global aliases.
cdef LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
#
# Retrieve the target value of an alias.
cdef LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
#
# Set the target value of an alias.
cdef void LLVMAliasSetAliasee(LLVMValueRef Alias,LLVMValueRef Aliasee)
#
# Remove a function from its containing module and deletes it.
#
# @see llvm::Function::eraseFromParent()
cdef void LLVMDeleteFunction(LLVMValueRef Fn)
#
# Check whether the given function has a personality function.
#
# @see llvm::Function::hasPersonalityFn()
cdef int LLVMHasPersonalityFn(LLVMValueRef Fn)
#
# Obtain the personality function attached to the function.
#
# @see llvm::Function::getPersonalityFn()
cdef LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
#
# Set the personality function attached to the function.
#
# @see llvm::Function::setPersonalityFn()
cdef void LLVMSetPersonalityFn(LLVMValueRef Fn,LLVMValueRef PersonalityFn)
#
# Obtain the intrinsic ID number which matches the given function name.
#
# @see llvm::Intrinsic::lookupIntrinsicID()
cdef unsigned int LLVMLookupIntrinsicID(const char * Name,size_t NameLen)
#
# Obtain the ID number from a function instance.
#
# @see llvm::Function::getIntrinsicID()
cdef unsigned int LLVMGetIntrinsicID(LLVMValueRef Fn)
#
# Get or insert the declaration of an intrinsic. For overloaded intrinsics,
# overload types must be provided to uniquely identify an overload.
#
# @see llvm::Intrinsic::getOrInsertDeclaration()
cdef LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod,unsigned int ID,LLVMTypeRef * OverloadTypes,size_t OverloadCount)
#
# Retrieves the type of an intrinsic. For overloaded intrinsics, overload
# types must be provided to uniquely identify an overload.
#
# @see llvm::Intrinsic::getType()
cdef LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx,unsigned int ID,LLVMTypeRef * OverloadTypes,size_t OverloadCount)
#
# Retrieves the name of an intrinsic.
#
# @see llvm::Intrinsic::getName()
cdef const char * LLVMIntrinsicGetName(unsigned int ID,size_t * NameLength)
# Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
cdef char * LLVMIntrinsicCopyOverloadedName(unsigned int ID,LLVMTypeRef * OverloadTypes,size_t OverloadCount,size_t * NameLength)
#
# Copies the name of an overloaded intrinsic identified by a given list of
# overload types.
#
# Unlike LLVMIntrinsicGetName, the caller is responsible for freeing the
# returned string.
#
# This version also supports unnamed types.
#
# @see llvm::Intrinsic::getName()
cdef char * LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod,unsigned int ID,LLVMTypeRef * OverloadTypes,size_t OverloadCount,size_t * NameLength)
#
# Obtain if the intrinsic identified by the given ID is overloaded.
#
# @see llvm::Intrinsic::isOverloaded()
cdef int LLVMIntrinsicIsOverloaded(unsigned int ID)
#
# Obtain the calling function of a function.
#
# The returned value corresponds to the LLVMCallConv enumeration.
#
# @see llvm::Function::getCallingConv()
cdef unsigned int LLVMGetFunctionCallConv(LLVMValueRef Fn)
#
# Set the calling convention of a function.
#
# @see llvm::Function::setCallingConv()
#
# @param Fn Function to operate on
# @param CC LLVMCallConv to set calling convention to
cdef void LLVMSetFunctionCallConv(LLVMValueRef Fn,unsigned int CC)
#
# Obtain the name of the garbage collector to use during code
# generation.
#
# @see llvm::Function::getGC()
cdef const char * LLVMGetGC(LLVMValueRef Fn)
#
# Define the garbage collector to use during code generation.
#
# @see llvm::Function::setGC()
cdef void LLVMSetGC(LLVMValueRef Fn,const char * Name)
#
# Gets the prefix data associated with a function. Only valid on functions, and
# only if LLVMHasPrefixData returns true.
# See https://llvm.org/docs/LangRef.html#prefix-data
cdef LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
#
# Check if a given function has prefix data. Only valid on functions.
# See https://llvm.org/docs/LangRef.html#prefix-data
cdef int LLVMHasPrefixData(LLVMValueRef Fn)
#
# Sets the prefix data for the function. Only valid on functions.
# See https://llvm.org/docs/LangRef.html#prefix-data
cdef void LLVMSetPrefixData(LLVMValueRef Fn,LLVMValueRef prefixData)
#
# Gets the prologue data associated with a function. Only valid on functions,
# and only if LLVMHasPrologueData returns true.
# See https://llvm.org/docs/LangRef.html#prologue-data
cdef LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
#
# Check if a given function has prologue data. Only valid on functions.
# See https://llvm.org/docs/LangRef.html#prologue-data
cdef int LLVMHasPrologueData(LLVMValueRef Fn)
#
# Sets the prologue data for the function. Only valid on functions.
# See https://llvm.org/docs/LangRef.html#prologue-data
cdef void LLVMSetPrologueData(LLVMValueRef Fn,LLVMValueRef prologueData)
#
# Add an attribute to a function.
#
# @see llvm::Function::addAttribute()
cdef void LLVMAddAttributeAtIndex(LLVMValueRef F,unsigned int Idx,LLVMAttributeRef A)
cdef unsigned int LLVMGetAttributeCountAtIndex(LLVMValueRef F,unsigned int Idx)
cdef void LLVMGetAttributesAtIndex(LLVMValueRef F,unsigned int Idx,LLVMAttributeRef * Attrs)
cdef LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F,unsigned int Idx,unsigned int KindID)
cdef LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F,unsigned int Idx,const char * K,unsigned int KLen)
cdef void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F,unsigned int Idx,unsigned int KindID)
cdef void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F,unsigned int Idx,const char * K,unsigned int KLen)
#
# Add a target-dependent attribute to a function
# @see llvm::AttrBuilder::addAttribute()
cdef void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn,const char * A,const char * V)
#
# Obtain the number of parameters in a function.
#
# @see llvm::Function::arg_size()
cdef unsigned int LLVMCountParams(LLVMValueRef Fn)
#
# Obtain the parameters in a function.
#
# The takes a pointer to a pre-allocated array of LLVMValueRef that is
# at least LLVMCountParams() long. This array will be filled with
# LLVMValueRef instances which correspond to the parameters the
# function receives. Each LLVMValueRef corresponds to a llvm::Argument
# instance.
#
# @see llvm::Function::arg_begin()
cdef void LLVMGetParams(LLVMValueRef Fn,LLVMValueRef * Params)
#
# Obtain the parameter at the specified index.
#
# Parameters are indexed from 0.
#
# @see llvm::Function::arg_begin()
cdef LLVMValueRef LLVMGetParam(LLVMValueRef Fn,unsigned int Index)
#
# Obtain the function to which this argument belongs.
#
# Unlike other functions in this group, this one takes an LLVMValueRef
# that corresponds to a llvm::Attribute.
#
# The returned LLVMValueRef is the llvm::Function to which this
# argument belongs.
cdef LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst)
#
# Obtain the first parameter to a function.
#
# @see llvm::Function::arg_begin()
cdef LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
#
# Obtain the last parameter to a function.
#
# @see llvm::Function::arg_end()
cdef LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
#
# Obtain the next parameter to a function.
#
# This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
# actually a wrapped iterator) and obtains the next parameter from the
# underlying iterator.
cdef LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
#
# Obtain the previous parameter to a function.
#
# This is the opposite of LLVMGetNextParam().
cdef LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
#
# Set the alignment for a function parameter.
#
# @see llvm::Argument::addAttr()
# @see llvm::AttrBuilder::addAlignmentAttr()
cdef void LLVMSetParamAlignment(LLVMValueRef Arg,unsigned int Align)
#
# Add a global indirect function to a module under a specified name.
#
# @see llvm::GlobalIFunc::create()
cdef LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M,const char * Name,size_t NameLen,LLVMTypeRef Ty,unsigned int AddrSpace,LLVMValueRef Resolver)
#
# Obtain a GlobalIFunc value from a Module by its name.
#
# The returned value corresponds to a llvm::GlobalIFunc value.
#
# @see llvm::Module::getNamedIFunc()
cdef LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M,const char * Name,size_t NameLen)
#
# Obtain an iterator to the first GlobalIFunc in a Module.
#
# @see llvm::Module::ifunc_begin()
cdef LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
#
# Obtain an iterator to the last GlobalIFunc in a Module.
#
# @see llvm::Module::ifunc_end()
cdef LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
#
# Advance a GlobalIFunc iterator to the next GlobalIFunc.
#
# Returns NULL if the iterator was already at the end and there are no more
# global aliases.
cdef LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
#
# Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
#
# Returns NULL if the iterator was already at the beginning and there are
# no previous global aliases.
cdef LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
#
# Retrieves the resolver function associated with this indirect function, or
# NULL if it doesn't not exist.
#
# @see llvm::GlobalIFunc::getResolver()
cdef LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
#
# Sets the resolver function associated with this indirect function.
#
# @see llvm::GlobalIFunc::setResolver()
cdef void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc,LLVMValueRef Resolver)
#
# Remove a global indirect function from its parent module and delete it.
#
# @see llvm::GlobalIFunc::eraseFromParent()
cdef void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
#
# Remove a global indirect function from its parent module.
#
# This unlinks the global indirect function from its containing module but
# keeps it alive.
#
# @see llvm::GlobalIFunc::removeFromParent()
cdef void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
#
# Create an MDString value from a given string value.
#
# The MDString value does not take ownership of the given string, it remains
# the responsibility of the caller to free it.
#
# @see llvm::MDString::get()
cdef LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C,const char * Str,size_t SLen)
#
# Create an MDNode value with the given array of operands.
#
# @see llvm::MDNode::get()
cdef LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C,LLVMMetadataRef * MDs,size_t Count)
#
# Obtain a Metadata as a Value.
cdef LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C,LLVMMetadataRef MD)
#
# Obtain a Value as a Metadata.
cdef LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)
#
# Obtain the underlying string from a MDString value.
#
# @param V Instance to obtain string from.
# @param Length Memory address which will hold length of returned string.
# @return String data in MDString.
cdef const char * LLVMGetMDString(LLVMValueRef V,unsigned int * Length)
#
# Obtain the number of operands from an MDNode value.
#
# @param V MDNode to get number of operands from.
# @return Number of operands of the MDNode.
cdef unsigned int LLVMGetMDNodeNumOperands(LLVMValueRef V)
#
# Obtain the given MDNode's operands.
#
# The passed LLVMValueRef pointer should point to enough memory to hold all of
# the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
# LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
# MDNode's operands.
#
# @param V MDNode to get the operands from.
# @param Dest Destination array for operands.
cdef void LLVMGetMDNodeOperands(LLVMValueRef V,LLVMValueRef * Dest)
#
# Replace an operand at a specific index in a llvm::MDNode value.
#
# @see llvm::MDNode::replaceOperandWith()
cdef void LLVMReplaceMDNodeOperandWith(LLVMValueRef V,unsigned int Index,LLVMMetadataRef Replacement)
# Deprecated: Use LLVMMDStringInContext2 instead.
cdef LLVMValueRef LLVMMDStringInContext(LLVMContextRef C,const char * Str,unsigned int SLen)
# Deprecated: Use LLVMMDStringInContext2 instead.
cdef LLVMValueRef LLVMMDString(const char * Str,unsigned int SLen)
# Deprecated: Use LLVMMDNodeInContext2 instead.
cdef LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C,LLVMValueRef * Vals,unsigned int Count)
# Deprecated: Use LLVMMDNodeInContext2 instead.
cdef LLVMValueRef LLVMMDNode(LLVMValueRef * Vals,unsigned int Count)
#
# Create a new operand bundle.
#
# Every invocation should be paired with LLVMDisposeOperandBundle() or memory
# will be leaked.
#
# @param Tag Tag name of the operand bundle
# @param TagLen Length of Tag
# @param Args Memory address of an array of bundle operands
# @param NumArgs Length of Args
cdef LLVMOperandBundleRef LLVMCreateOperandBundle(const char * Tag,size_t TagLen,LLVMValueRef * Args,unsigned int NumArgs)
#
# Destroy an operand bundle.
#
# This must be called for every created operand bundle or memory will be
# leaked.
cdef void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
#
# Obtain the tag of an operand bundle as a string.
#
# @param Bundle Operand bundle to obtain tag of.
# @param Len Out parameter which holds the length of the returned string.
# @return The tag name of Bundle.
# @see OperandBundleDef::getTag()
cdef const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle,size_t * Len)
#
# Obtain the number of operands for an operand bundle.
#
# @param Bundle Operand bundle to obtain operand count of.
# @return The number of operands.
# @see OperandBundleDef::input_size()
cdef unsigned int LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
#
# Obtain the operand for an operand bundle at the given index.
#
# @param Bundle Operand bundle to obtain operand of.
# @param Index An operand index, must be less than
# LLVMGetNumOperandBundleArgs().
# @return The operand.
cdef LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle,unsigned int Index)
#
# Convert a basic block instance to a value type.
cdef LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
#
# Determine whether an LLVMValueRef is itself a basic block.
cdef int LLVMValueIsBasicBlock(LLVMValueRef Val)
#
# Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
cdef LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
#
# Obtain the string name of a basic block.
cdef const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
#
# Obtain the function to which a basic block belongs.
#
# @see llvm::BasicBlock::getParent()
cdef LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
#
# Obtain the terminator instruction for a basic block.
#
# If the basic block does not have a terminator (it is not well-formed
# if it doesn't), then NULL is returned.
#
# The returned LLVMValueRef corresponds to an llvm::Instruction.
#
# @see llvm::BasicBlock::getTerminator()
cdef LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
#
# Obtain the number of basic blocks in a function.
#
# @param Fn Function value to operate on.
cdef unsigned int LLVMCountBasicBlocks(LLVMValueRef Fn)
#
# Obtain all of the basic blocks in a function.
#
# This operates on a function value. The BasicBlocks parameter is a
# pointer to a pre-allocated array of LLVMBasicBlockRef of at least
# LLVMCountBasicBlocks() in length. This array is populated with
# LLVMBasicBlockRef instances.
cdef void LLVMGetBasicBlocks(LLVMValueRef Fn,LLVMBasicBlockRef * BasicBlocks)
#
# Obtain the first basic block in a function.
#
# The returned basic block can be used as an iterator. You will likely
# eventually call into LLVMGetNextBasicBlock() with it.
#
# @see llvm::Function::begin()
cdef LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
#
# Obtain the last basic block in a function.
#
# @see llvm::Function::end()
cdef LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
#
# Advance a basic block iterator.
cdef LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
#
# Go backwards in a basic block iterator.
cdef LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
#
# Obtain the basic block that corresponds to the entry point of a
# function.
#
# @see llvm::Function::getEntryBlock()
cdef LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
#
# Insert the given basic block after the insertion point of the given builder.
#
# The insertion point must be valid.
#
# @see llvm::Function::BasicBlockListType::insertAfter()
cdef void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder,LLVMBasicBlockRef BB)
#
# Append the given basic block to the basic block list of the given function.
#
# @see llvm::Function::BasicBlockListType::push_back()
cdef void LLVMAppendExistingBasicBlock(LLVMValueRef Fn,LLVMBasicBlockRef BB)
#
# Create a new basic block without inserting it into a function.
#
# @see llvm::BasicBlock::Create()
cdef LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C,const char * Name)
#
# Append a basic block to the end of a function.
#
# @see llvm::BasicBlock::Create()
cdef LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C,LLVMValueRef Fn,const char * Name)
#
# Append a basic block to the end of a function using the global
# context.
#
# @see llvm::BasicBlock::Create()
cdef LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn,const char * Name)
#
# Insert a basic block in a function before another basic block.
#
# The function to add to is determined by the function of the
# passed basic block.
#
# @see llvm::BasicBlock::Create()
cdef LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C,LLVMBasicBlockRef BB,const char * Name)
#
# Insert a basic block in a function using the global context.
#
# @see llvm::BasicBlock::Create()
cdef LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,const char * Name)
#
# Remove a basic block from a function and delete it.
#
# This deletes the basic block from its containing function and deletes
# the basic block itself.
#
# @see llvm::BasicBlock::eraseFromParent()
cdef void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB)
#
# Remove a basic block from a function.
#
# This deletes the basic block from its containing function but keep
# the basic block alive.
#
# @see llvm::BasicBlock::removeFromParent()
cdef void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB)
#
# Move a basic block to before another one.
#
# @see llvm::BasicBlock::moveBefore()
cdef void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB,LLVMBasicBlockRef MovePos)
#
# Move a basic block to after another one.
#
# @see llvm::BasicBlock::moveAfter()
cdef void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB,LLVMBasicBlockRef MovePos)
#
# Obtain the first instruction in a basic block.
#
# The returned LLVMValueRef corresponds to a llvm::Instruction
# instance.
cdef LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
#
# Obtain the last instruction in a basic block.
#
# The returned LLVMValueRef corresponds to an LLVM:Instruction.
cdef LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
#
# Determine whether an instruction has any metadata attached.
cdef int LLVMHasMetadata(LLVMValueRef Val)
#
# Return metadata associated with an instruction value.
cdef LLVMValueRef LLVMGetMetadata(LLVMValueRef Val,unsigned int KindID)
#
# Set metadata associated with an instruction value.
cdef void LLVMSetMetadata(LLVMValueRef Val,unsigned int KindID,LLVMValueRef Node)
#
# Returns the metadata associated with an instruction value, but filters out
# all the debug locations.
#
# @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
cdef LLVMOpaqueValueMetadataEntry * LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Instr,size_t * NumEntries)
#
# Obtain the basic block to which an instruction belongs.
#
# @see llvm::Instruction::getParent()
cdef LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
#
# Obtain the instruction that occurs after the one specified.
#
# The next instruction will be from the same basic block.
#
# If this is the last instruction in a basic block, NULL will be
# returned.
cdef LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
#
# Obtain the instruction that occurred before this one.
#
# If the instruction is the first instruction in a basic block, NULL
# will be returned.
cdef LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
#
# Remove an instruction.
#
# The instruction specified is removed from its containing building
# block but is kept alive.
#
# @see llvm::Instruction::removeFromParent()
cdef void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
#
# Remove and delete an instruction.
#
# The instruction specified is removed from its containing building
# block and then deleted.
#
# @see llvm::Instruction::eraseFromParent()
cdef void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
#
# Delete an instruction.
#
# The instruction specified is deleted. It must have previously been
# removed from its containing building block.
#
# @see llvm::Value::deleteValue()
cdef void LLVMDeleteInstruction(LLVMValueRef Inst)
#
# Obtain the code opcode for an individual instruction.
#
# @see llvm::Instruction::getOpCode()
cdef LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
#
# Obtain the predicate of an instruction.
#
# This is only valid for instructions that correspond to llvm::ICmpInst.
#
# @see llvm::ICmpInst::getPredicate()
cdef LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
#
# Get whether or not an icmp instruction has the samesign flag.
#
# This is only valid for instructions that correspond to llvm::ICmpInst.
#
# @see llvm::ICmpInst::hasSameSign()
cdef int LLVMGetICmpSameSign(LLVMValueRef Inst)
#
# Set the samesign flag on an icmp instruction.
#
# This is only valid for instructions that correspond to llvm::ICmpInst.
#
# @see llvm::ICmpInst::setSameSign()
cdef void LLVMSetICmpSameSign(LLVMValueRef Inst,int SameSign)
#
# Obtain the float predicate of an instruction.
#
# This is only valid for instructions that correspond to llvm::FCmpInst.
#
# @see llvm::FCmpInst::getPredicate()
cdef LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
#
# Create a copy of 'this' instruction that is identical in all ways
# except the following:
# * The instruction has no parent
# * The instruction has no name
#
# @see llvm::Instruction::clone()
cdef LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
#
# Determine whether an instruction is a terminator. This routine is named to
# be compatible with historical functions that did this by querying the
# underlying C++ type.
#
# @see llvm::Instruction::isTerminator()
cdef LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
#
# Obtain the first debug record attached to an instruction.
#
# Use LLVMGetNextDbgRecord() and LLVMGetPreviousDbgRecord() to traverse the
# sequence of DbgRecords.
#
# Return the first DbgRecord attached to Inst or NULL if there are none.
#
# @see llvm::Instruction::getDbgRecordRange()
cdef LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
#
# Obtain the last debug record attached to an instruction.
#
# Return the last DbgRecord attached to Inst or NULL if there are none.
#
# @see llvm::Instruction::getDbgRecordRange()
cdef LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
#
# Obtain the next DbgRecord in the sequence or NULL if there are no more.
#
# @see llvm::Instruction::getDbgRecordRange()
cdef LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef DbgRecord)
#
# Obtain the previous DbgRecord in the sequence or NULL if there are no more.
#
# @see llvm::Instruction::getDbgRecordRange()
cdef LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef DbgRecord)
#
# Get the debug location attached to the debug record.
#
# @see llvm::DbgRecord::getDebugLoc()
cdef LLVMMetadataRef LLVMDbgRecordGetDebugLoc(LLVMDbgRecordRef Rec)
cdef LLVMDbgRecordKind LLVMDbgRecordGetKind(LLVMDbgRecordRef Rec)
#
# Get the value of the DbgVariableRecord.
#
# @see llvm::DbgVariableRecord::getValue()
cdef LLVMValueRef LLVMDbgVariableRecordGetValue(LLVMDbgRecordRef Rec,unsigned int OpIdx)
#
# Get the debug info variable of the DbgVariableRecord.
#
# @see llvm::DbgVariableRecord::getVariable()
cdef LLVMMetadataRef LLVMDbgVariableRecordGetVariable(LLVMDbgRecordRef Rec)
#
# Get the debug info expression of the DbgVariableRecord.
#
# @see llvm::DbgVariableRecord::getExpression()
cdef LLVMMetadataRef LLVMDbgVariableRecordGetExpression(LLVMDbgRecordRef Rec)
#
# Obtain the argument count for a call instruction.
#
# This expects an LLVMValueRef that corresponds to a llvm::CallInst,
# llvm::InvokeInst, or llvm:FuncletPadInst.
#
# @see llvm::CallInst::getNumArgOperands()
# @see llvm::InvokeInst::getNumArgOperands()
# @see llvm::FuncletPadInst::getNumArgOperands()
cdef unsigned int LLVMGetNumArgOperands(LLVMValueRef Instr)
#
# Set the calling convention for a call instruction.
#
# This expects an LLVMValueRef that corresponds to a llvm::CallInst or
# llvm::InvokeInst.
#
# @see llvm::CallInst::setCallingConv()
# @see llvm::InvokeInst::setCallingConv()
cdef void LLVMSetInstructionCallConv(LLVMValueRef Instr,unsigned int CC)
#
# Obtain the calling convention for a call instruction.
#
# This is the opposite of LLVMSetInstructionCallConv(). Reads its
# usage.
#
# @see LLVMSetInstructionCallConv()
cdef unsigned int LLVMGetInstructionCallConv(LLVMValueRef Instr)
cdef void LLVMSetInstrParamAlignment(LLVMValueRef Instr,unsigned int Idx,unsigned int Align)
cdef void LLVMAddCallSiteAttribute(LLVMValueRef C,unsigned int Idx,LLVMAttributeRef A)
cdef unsigned int LLVMGetCallSiteAttributeCount(LLVMValueRef C,unsigned int Idx)
cdef void LLVMGetCallSiteAttributes(LLVMValueRef C,unsigned int Idx,LLVMAttributeRef * Attrs)
cdef LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C,unsigned int Idx,unsigned int KindID)
cdef LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C,unsigned int Idx,const char * K,unsigned int KLen)
cdef void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C,unsigned int Idx,unsigned int KindID)
cdef void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C,unsigned int Idx,const char * K,unsigned int KLen)
#
# Obtain the function type called by this instruction.
#
# @see llvm::CallBase::getFunctionType()
cdef LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C)
#
# Obtain the pointer to the function invoked by this instruction.
#
# This expects an LLVMValueRef that corresponds to a llvm::CallInst or
# llvm::InvokeInst.
#
# @see llvm::CallInst::getCalledOperand()
# @see llvm::InvokeInst::getCalledOperand()
cdef LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
#
# Obtain the number of operand bundles attached to this instruction.
#
# This only works on llvm::CallInst and llvm::InvokeInst instructions.
#
# @see llvm::CallBase::getNumOperandBundles()
cdef unsigned int LLVMGetNumOperandBundles(LLVMValueRef C)
#
# Obtain the operand bundle attached to this instruction at the given index.
# Use LLVMDisposeOperandBundle to free the operand bundle.
#
# This only works on llvm::CallInst and llvm::InvokeInst instructions.
cdef LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C,unsigned int Index)
#
# Obtain whether a call instruction is a tail call.
#
# This only works on llvm::CallInst instructions.
#
# @see llvm::CallInst::isTailCall()
cdef int LLVMIsTailCall(LLVMValueRef CallInst)
#
# Set whether a call instruction is a tail call.
#
# This only works on llvm::CallInst instructions.
#
# @see llvm::CallInst::setTailCall()
cdef void LLVMSetTailCall(LLVMValueRef CallInst,int IsTailCall)
#
# Obtain a tail call kind of the call instruction.
#
# @see llvm::CallInst::setTailCallKind()
cdef LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef CallInst)
#
# Set the call kind of the call instruction.
#
# @see llvm::CallInst::getTailCallKind()
cdef void LLVMSetTailCallKind(LLVMValueRef CallInst,LLVMTailCallKind kind)
#
# Return the normal destination basic block.
#
# This only works on llvm::InvokeInst instructions.
#
# @see llvm::InvokeInst::getNormalDest()
cdef LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst)
#
# Return the unwind destination basic block.
#
# Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
# llvm::CatchSwitchInst instructions.
#
# @see llvm::InvokeInst::getUnwindDest()
# @see llvm::CleanupReturnInst::getUnwindDest()
# @see llvm::CatchSwitchInst::getUnwindDest()
cdef LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst)
#
# Set the normal destination basic block.
#
# This only works on llvm::InvokeInst instructions.
#
# @see llvm::InvokeInst::setNormalDest()
cdef void LLVMSetNormalDest(LLVMValueRef InvokeInst,LLVMBasicBlockRef B)
#
# Set the unwind destination basic block.
#
# Works on llvm::InvokeInst, llvm::CleanupReturnInst, and
# llvm::CatchSwitchInst instructions.
#
# @see llvm::InvokeInst::setUnwindDest()
# @see llvm::CleanupReturnInst::setUnwindDest()
# @see llvm::CatchSwitchInst::setUnwindDest()
cdef void LLVMSetUnwindDest(LLVMValueRef InvokeInst,LLVMBasicBlockRef B)
#
# Get the default destination of a CallBr instruction.
#
# @see llvm::CallBrInst::getDefaultDest()
cdef LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
#
# Get the number of indirect destinations of a CallBr instruction.
#
# @see llvm::CallBrInst::getNumIndirectDests()
#
cdef unsigned int LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
#
# Get the indirect destination of a CallBr instruction at the given index.
#
# @see llvm::CallBrInst::getIndirectDest()
cdef LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr,unsigned int Idx)
#
# Return the number of successors that this terminator has.
#
# @see llvm::Instruction::getNumSuccessors
cdef unsigned int LLVMGetNumSuccessors(LLVMValueRef Term)
#
# Return the specified successor.
#
# @see llvm::Instruction::getSuccessor
cdef LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term,unsigned int i)
#
# Update the specified successor to point at the provided block.
#
# @see llvm::Instruction::setSuccessor
cdef void LLVMSetSuccessor(LLVMValueRef Term,unsigned int i,LLVMBasicBlockRef block)
#
# Return if an instruction is a conditional branch.
#
# Deprecated: Use LLVMIsACondBrInst instead.
cdef int LLVMIsConditional(LLVMValueRef Branch)
#
# Return the condition of a branch instruction.
#
# This only works on llvm::CondBrInst instructions.
#
# @see llvm::CondBrInst::getCondition
cdef LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
#
# Set the condition of a branch instruction.
#
# This only works on llvm::CondBrInst instructions.
#
# @see llvm::CondBrInst::setCondition
cdef void LLVMSetCondition(LLVMValueRef Branch,LLVMValueRef Cond)
#
# Obtain the default destination basic block of a switch instruction.
#
# This only works on llvm::SwitchInst instructions.
#
# @see llvm::SwitchInst::getDefaultDest()
cdef LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr)
#
# Obtain the case value for a successor of a switch instruction. i corresponds
# to the successor index. The first successor is the default destination, so i
# must be greater than zero.
#
# This only works on llvm::SwitchInst instructions.
#
# @see llvm::SwitchInst::CaseHandle::getCaseValue()
cdef LLVMValueRef LLVMGetSwitchCaseValue(LLVMValueRef SwitchInstr,unsigned int i)
#
# Set the case value for a successor of a switch instruction. i corresponds to
# the successor index. The first successor is the default destination, so i
# must be greater than zero.
#
# This only works on llvm::SwitchInst instructions.
#
# @see llvm::SwitchInst::CaseHandle::setValue()
cdef void LLVMSetSwitchCaseValue(LLVMValueRef SwitchInstr,unsigned int i,LLVMValueRef CaseValue)
#
# Obtain the type that is being allocated by the alloca instruction.
cdef LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
#
# Check whether the given GEP operator is inbounds.
cdef int LLVMIsInBounds(LLVMValueRef GEP)
#
# Set the given GEP instruction to be inbounds or not.
cdef void LLVMSetIsInBounds(LLVMValueRef GEP,int InBounds)
#
# Get the source element type of the given GEP operator.
cdef LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
#
# Get the no-wrap related flags for the given GEP instruction.
#
# @see llvm::GetElementPtrInst::getNoWrapFlags
cdef unsigned int LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
#
# Set the no-wrap related flags for the given GEP instruction.
#
# @see llvm::GetElementPtrInst::setNoWrapFlags
cdef void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP,unsigned int NoWrapFlags)
#
# Add an incoming value to the end of a PHI list.
cdef void LLVMAddIncoming(LLVMValueRef PhiNode,LLVMValueRef * IncomingValues,LLVMBasicBlockRef * IncomingBlocks,unsigned int Count)
#
# Obtain the number of incoming basic blocks to a PHI node.
cdef unsigned int LLVMCountIncoming(LLVMValueRef PhiNode)
#
# Obtain an incoming value to a PHI node as an LLVMValueRef.
cdef LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode,unsigned int Index)
#
# Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
cdef LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode,unsigned int Index)
#
# Obtain the number of indices.
# NB: This also works on GEP operators.
cdef unsigned int LLVMGetNumIndices(LLVMValueRef Inst)
#
# Obtain the indices as an array.
cdef const unsigned int * LLVMGetIndices(LLVMValueRef Inst)
#
# @defgroup LLVMCCoreInstructionBuilder Instruction Builders
#
# An instruction builder represents a point within a basic block and is
# the exclusive means of building instructions using the C interface.
#
cdef LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
cdef LLVMBuilderRef LLVMCreateBuilder()
#
# Set the builder position before Instr but after any attached debug records,
# or if Instr is null set the position to the end of Block.
cdef void LLVMPositionBuilder(LLVMBuilderRef Builder,LLVMBasicBlockRef Block,LLVMValueRef Instr)
#
# Set the builder position before Instr and any attached debug records,
# or if Instr is null set the position to the end of Block.
cdef void LLVMPositionBuilderBeforeDbgRecords(LLVMBuilderRef Builder,LLVMBasicBlockRef Block,LLVMValueRef Inst)
#
# Set the builder position before Instr but after any attached debug records.
cdef void LLVMPositionBuilderBefore(LLVMBuilderRef Builder,LLVMValueRef Instr)
#
# Set the builder position before Instr and any attached debug records.
cdef void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder,LLVMValueRef Instr)
cdef void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder,LLVMBasicBlockRef Block)
cdef LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
cdef void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
cdef void LLVMInsertIntoBuilder(LLVMBuilderRef Builder,LLVMValueRef Instr)
cdef void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder,LLVMValueRef Instr,const char * Name)
cdef void LLVMDisposeBuilder(LLVMBuilderRef Builder)
#
# Get location information used by debugging information.
#
# @see llvm::IRBuilder::getCurrentDebugLocation()
cdef LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
#
# Set location information used by debugging information.
#
# To clear the location metadata of the given instruction, pass NULL to \p Loc.
#
# @see llvm::IRBuilder::SetCurrentDebugLocation()
cdef void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder,LLVMMetadataRef Loc)
#
# Attempts to set the debug location for the given instruction using the
# current debug location for the given builder. If the builder has no current
# debug location, this function is a no-op.
#
# @deprecated LLVMSetInstDebugLocation is deprecated in favor of the more general
# LLVMAddMetadataToInst.
#
# @see llvm::IRBuilder::SetInstDebugLocation()
cdef void LLVMSetInstDebugLocation(LLVMBuilderRef Builder,LLVMValueRef Inst)
#
# Adds the metadata registered with the given builder to the given instruction.
#
# @see llvm::IRBuilder::AddMetadataToInst()
cdef void LLVMAddMetadataToInst(LLVMBuilderRef Builder,LLVMValueRef Inst)
#
# Get the dafult floating-point math metadata for a given builder.
#
# @see llvm::IRBuilder::getDefaultFPMathTag()
cdef LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
#
# Set the default floating-point math metadata for the given builder.
#
# To clear the metadata, pass NULL to \p FPMathTag.
#
# @see llvm::IRBuilder::setDefaultFPMathTag()
cdef void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,LLVMMetadataRef FPMathTag)
#
# Obtain the context to which this builder is associated.
#
# @see llvm::IRBuilder::getContext()
cdef LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
#
# Deprecated: Passing the NULL location will crash.
# Use LLVMGetCurrentDebugLocation2 instead.
cdef void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder,LLVMValueRef L)
#
# Deprecated: Returning the NULL location will crash.
# Use LLVMGetCurrentDebugLocation2 instead.
cdef LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
cdef LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef arg0)
cdef LLVMValueRef LLVMBuildRet(LLVMBuilderRef arg0,LLVMValueRef V)
cdef LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef arg0,LLVMValueRef * RetVals,unsigned int N)
cdef LLVMValueRef LLVMBuildBr(LLVMBuilderRef arg0,LLVMBasicBlockRef Dest)
cdef LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef arg0,LLVMValueRef If,LLVMBasicBlockRef Then,LLVMBasicBlockRef Else)
cdef LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef arg0,LLVMValueRef V,LLVMBasicBlockRef Else,unsigned int NumCases)
cdef LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B,LLVMValueRef Addr,unsigned int NumDests)
cdef LLVMValueRef LLVMBuildCallBr(LLVMBuilderRef B,LLVMTypeRef Ty,LLVMValueRef Fn,LLVMBasicBlockRef DefaultDest,LLVMBasicBlockRef * IndirectDests,unsigned int NumIndirectDests,LLVMValueRef * Args,unsigned int NumArgs,LLVMOperandBundleRef * Bundles,unsigned int NumBundles,const char * Name)
cdef LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef arg0,LLVMTypeRef Ty,LLVMValueRef Fn,LLVMValueRef * Args,unsigned int NumArgs,LLVMBasicBlockRef Then,LLVMBasicBlockRef Catch,const char * Name)
cdef LLVMValueRef LLVMBuildInvokeWithOperandBundles(LLVMBuilderRef arg0,LLVMTypeRef Ty,LLVMValueRef Fn,LLVMValueRef * Args,unsigned int NumArgs,LLVMBasicBlockRef Then,LLVMBasicBlockRef Catch,LLVMOperandBundleRef * Bundles,unsigned int NumBundles,const char * Name)
cdef LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef arg0)
cdef LLVMValueRef LLVMBuildResume(LLVMBuilderRef B,LLVMValueRef Exn)
cdef LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B,LLVMTypeRef Ty,LLVMValueRef PersFn,unsigned int NumClauses,const char * Name)
cdef LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B,LLVMValueRef CatchPad,LLVMBasicBlockRef BB)
cdef LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B,LLVMValueRef CatchPad,LLVMBasicBlockRef BB)
cdef LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B,LLVMValueRef ParentPad,LLVMValueRef * Args,unsigned int NumArgs,const char * Name)
cdef LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B,LLVMValueRef ParentPad,LLVMValueRef * Args,unsigned int NumArgs,const char * Name)
cdef LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B,LLVMValueRef ParentPad,LLVMBasicBlockRef UnwindBB,unsigned int NumHandlers,const char * Name)
cdef void LLVMAddCase(LLVMValueRef Switch,LLVMValueRef OnVal,LLVMBasicBlockRef Dest)
cdef void LLVMAddDestination(LLVMValueRef IndirectBr,LLVMBasicBlockRef Dest)
cdef unsigned int LLVMGetNumClauses(LLVMValueRef LandingPad)
cdef LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad,unsigned int Idx)
cdef void LLVMAddClause(LLVMValueRef LandingPad,LLVMValueRef ClauseVal)
cdef int LLVMIsCleanup(LLVMValueRef LandingPad)
cdef void LLVMSetCleanup(LLVMValueRef LandingPad,int Val)
cdef void LLVMAddHandler(LLVMValueRef CatchSwitch,LLVMBasicBlockRef Dest)
cdef unsigned int LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
#
# Obtain the basic blocks acting as handlers for a catchswitch instruction.
#
# The Handlers parameter should point to a pre-allocated array of
# LLVMBasicBlockRefs at least LLVMGetNumHandlers() large. On return, the
# first LLVMGetNumHandlers() entries in the array will be populated
# with LLVMBasicBlockRef instances.
#
# @param CatchSwitch The catchswitch instruction to operate on.
# @param Handlers Memory address of an array to be filled with basic blocks.
cdef void LLVMGetHandlers(LLVMValueRef CatchSwitch,LLVMBasicBlockRef * Handlers)
cdef LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet,unsigned int i)
cdef void LLVMSetArgOperand(LLVMValueRef Funclet,unsigned int i,LLVMValueRef value)
#
# Get the parent catchswitch instruction of a catchpad instruction.
#
# This only works on llvm::CatchPadInst instructions.
#
# @see llvm::CatchPadInst::getCatchSwitch()
cdef LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
#
# Set the parent catchswitch instruction of a catchpad instruction.
#
# This only works on llvm::CatchPadInst instructions.
#
# @see llvm::CatchPadInst::setCatchSwitch()
cdef void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad,LLVMValueRef CatchSwitch)
cdef LLVMValueRef LLVMBuildAdd(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildSub(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFSub(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildMul(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFMul(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildURem(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildSRem(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFRem(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildShl(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildLShr(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildAShr(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildAnd(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildOr(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildXor(LLVMBuilderRef arg0,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B,LLVMOpcode Op,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildNeg(LLVMBuilderRef arg0,LLVMValueRef V,const char * Name)
cdef LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B,LLVMValueRef V,const char * Name)
cdef LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B,LLVMValueRef V,const char * Name)
cdef LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef arg0,LLVMValueRef V,const char * Name)
cdef LLVMValueRef LLVMBuildNot(LLVMBuilderRef arg0,LLVMValueRef V,const char * Name)
cdef int LLVMGetNUW(LLVMValueRef ArithInst)
cdef void LLVMSetNUW(LLVMValueRef ArithInst,int HasNUW)
cdef int LLVMGetNSW(LLVMValueRef ArithInst)
cdef void LLVMSetNSW(LLVMValueRef ArithInst,int HasNSW)
cdef int LLVMGetExact(LLVMValueRef DivOrShrInst)
cdef void LLVMSetExact(LLVMValueRef DivOrShrInst,int IsExact)
#
# Gets if the instruction has the non-negative flag set.
# Only valid for zext instructions.
cdef int LLVMGetNNeg(LLVMValueRef NonNegInst)
#
# Sets the non-negative flag for the instruction.
# Only valid for zext instructions.
cdef void LLVMSetNNeg(LLVMValueRef NonNegInst,int IsNonNeg)
#
# Get the flags for which fast-math-style optimizations are allowed for this
# value.
#
# Only valid on floating point instructions.
# @see LLVMCanValueUseFastMathFlags
cdef unsigned int LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
#
# Sets the flags for which fast-math-style optimizations are allowed for this
# value.
#
# Only valid on floating point instructions.
# @see LLVMCanValueUseFastMathFlags
cdef void LLVMSetFastMathFlags(LLVMValueRef FPMathInst,unsigned int FMF)
#
# Check if a given value can potentially have fast math flags.
#
# Will return true for floating point arithmetic instructions, and for select,
# phi, and call instructions whose type is a floating point type, or a vector
# or array thereof. See https://llvm.org/docs/LangRef.html#fast-math-flags
cdef int LLVMCanValueUseFastMathFlags(LLVMValueRef Inst)
#
# Gets whether the instruction has the disjoint flag set.
# Only valid for or instructions.
cdef int LLVMGetIsDisjoint(LLVMValueRef Inst)
#
# Sets the disjoint flag for the instruction.
# Only valid for or instructions.
cdef void LLVMSetIsDisjoint(LLVMValueRef Inst,int IsDisjoint)
cdef LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef arg0,LLVMTypeRef Ty,const char * Name)
cdef LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef arg0,LLVMTypeRef Ty,LLVMValueRef Val,const char * Name)
#
# Creates and inserts a memset to the specified pointer and the
# specified value.
#
# @see llvm::IRRBuilder::CreateMemSet()
cdef LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B,LLVMValueRef Ptr,LLVMValueRef Val,LLVMValueRef Len,unsigned int Align)
#
# Creates and inserts a memcpy between the specified pointers.
#
# @see llvm::IRRBuilder::CreateMemCpy()
cdef LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B,LLVMValueRef Dst,unsigned int DstAlign,LLVMValueRef Src,unsigned int SrcAlign,LLVMValueRef Size)
#
# Creates and inserts a memmove between the specified pointers.
#
# @see llvm::IRRBuilder::CreateMemMove()
cdef LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B,LLVMValueRef Dst,unsigned int DstAlign,LLVMValueRef Src,unsigned int SrcAlign,LLVMValueRef Size)
cdef LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef arg0,LLVMTypeRef Ty,const char * Name)
cdef LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef arg0,LLVMTypeRef Ty,LLVMValueRef Val,const char * Name)
cdef LLVMValueRef LLVMBuildFree(LLVMBuilderRef arg0,LLVMValueRef PointerVal)
cdef LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef arg0,LLVMTypeRef Ty,LLVMValueRef PointerVal,const char * Name)
cdef LLVMValueRef LLVMBuildStore(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMValueRef Ptr)
cdef LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B,LLVMTypeRef Ty,LLVMValueRef Pointer,LLVMValueRef * Indices,unsigned int NumIndices,const char * Name)
cdef LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B,LLVMTypeRef Ty,LLVMValueRef Pointer,LLVMValueRef * Indices,unsigned int NumIndices,const char * Name)
#
# Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows
# specifying the no-wrap flags.
#
# @see llvm::IRBuilder::CreateGEP()
cdef LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B,LLVMTypeRef Ty,LLVMValueRef Pointer,LLVMValueRef * Indices,unsigned int NumIndices,const char * Name,unsigned int NoWrapFlags)
cdef LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B,LLVMTypeRef Ty,LLVMValueRef Pointer,unsigned int Idx,const char * Name)
cdef LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B,const char * Str,const char * Name)
#
# Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
cdef LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B,const char * Str,const char * Name)
cdef int LLVMGetVolatile(LLVMValueRef Inst)
cdef void LLVMSetVolatile(LLVMValueRef MemoryAccessInst,int IsVolatile)
cdef int LLVMGetWeak(LLVMValueRef CmpXchgInst)
cdef void LLVMSetWeak(LLVMValueRef CmpXchgInst,int IsWeak)
cdef LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst)
cdef void LLVMSetOrdering(LLVMValueRef MemoryAccessInst,LLVMAtomicOrdering Ordering)
cdef LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst)
cdef void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst,LLVMAtomicRMWBinOp BinOp)
cdef LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildZExt(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildSExt(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildCast(LLVMBuilderRef B,LLVMOpcode Op,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,int IsSigned,const char * Name)
cdef LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
# Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead.
cdef LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef arg0,LLVMValueRef Val,LLVMTypeRef DestTy,const char * Name)
cdef LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src,int SrcIsSigned,LLVMTypeRef DestTy,int DestIsSigned)
cdef LLVMValueRef LLVMBuildICmp(LLVMBuilderRef arg0,LLVMIntPredicate Op,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef arg0,LLVMRealPredicate Op,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildPhi(LLVMBuilderRef arg0,LLVMTypeRef Ty,const char * Name)
cdef LLVMValueRef LLVMBuildCall2(LLVMBuilderRef arg0,LLVMTypeRef arg1,LLVMValueRef Fn,LLVMValueRef * Args,unsigned int NumArgs,const char * Name)
cdef LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef arg0,LLVMTypeRef arg1,LLVMValueRef Fn,LLVMValueRef * Args,unsigned int NumArgs,LLVMOperandBundleRef * Bundles,unsigned int NumBundles,const char * Name)
cdef LLVMValueRef LLVMBuildSelect(LLVMBuilderRef arg0,LLVMValueRef If,LLVMValueRef Then,LLVMValueRef Else,const char * Name)
cdef LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef arg0,LLVMValueRef List,LLVMTypeRef Ty,const char * Name)
cdef LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef arg0,LLVMValueRef VecVal,LLVMValueRef Index,const char * Name)
cdef LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef arg0,LLVMValueRef VecVal,LLVMValueRef EltVal,LLVMValueRef Index,const char * Name)
cdef LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef arg0,LLVMValueRef V1,LLVMValueRef V2,LLVMValueRef Mask,const char * Name)
cdef LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef arg0,LLVMValueRef AggVal,unsigned int Index,const char * Name)
cdef LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef arg0,LLVMValueRef AggVal,LLVMValueRef EltVal,unsigned int Index,const char * Name)
cdef LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef arg0,LLVMValueRef Val,const char * Name)
cdef LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef arg0,LLVMValueRef Val,const char * Name)
cdef LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef arg0,LLVMValueRef Val,const char * Name)
cdef LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef arg0,LLVMTypeRef ElemTy,LLVMValueRef LHS,LLVMValueRef RHS,const char * Name)
cdef LLVMValueRef LLVMBuildFence(LLVMBuilderRef B,LLVMAtomicOrdering ordering,int singleThread,const char * Name)
cdef LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B,LLVMAtomicOrdering ordering,unsigned int SSID,const char * Name)
cdef LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,LLVMValueRef PTR,LLVMValueRef Val,LLVMAtomicOrdering ordering,int singleThread)
cdef LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,LLVMValueRef PTR,LLVMValueRef Val,LLVMAtomicOrdering ordering,unsigned int SSID)
cdef LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,LLVMValueRef Ptr,LLVMValueRef Cmp,LLVMValueRef New,LLVMAtomicOrdering SuccessOrdering,LLVMAtomicOrdering FailureOrdering,int SingleThread)
cdef LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B,LLVMValueRef Ptr,LLVMValueRef Cmp,LLVMValueRef New,LLVMAtomicOrdering SuccessOrdering,LLVMAtomicOrdering FailureOrdering,unsigned int SSID)
#
# Get the number of elements in the mask of a ShuffleVector instruction.
cdef unsigned int LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst)
#
# \returns a constant that specifies that the result of a \c ShuffleVectorInst
# is undefined.
cdef int LLVMGetUndefMaskElem()
#
# Get the mask value at position Elt in the mask of a ShuffleVector
# instruction.
#
# \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
# poison at that position.
cdef int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst,unsigned int Elt)
cdef int LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
cdef void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst,int SingleThread)
#
# Returns whether an instruction is an atomic instruction, e.g., atomicrmw,
# cmpxchg, fence, or loads and stores with atomic ordering.
cdef int LLVMIsAtomic(LLVMValueRef Inst)
#
# Returns the synchronization scope ID of an atomic instruction.
cdef unsigned int LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
#
# Sets the synchronization scope ID of an atomic instruction.
cdef void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst,unsigned int SSID)
cdef LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
cdef void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst,LLVMAtomicOrdering Ordering)
cdef LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
cdef void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst,LLVMAtomicOrdering Ordering)
#
# Changes the type of M so it can be passed to FunctionPassManagers and the
# JIT. They take ModuleProviders for historical reasons.
cdef LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
#
# Destroys the module M.
cdef void LLVMDisposeModuleProvider(LLVMModuleProviderRef M)
#
# @defgroup LLVMCCoreMemoryBuffers Memory Buffers
#
cdef int LLVMCreateMemoryBufferWithContentsOfFile(const char * Path,LLVMMemoryBufferRef * OutMemBuf,char ** OutMessage)
cdef int LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef * OutMemBuf,char ** OutMessage)
cdef LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char * InputData,size_t InputDataLength,const char * BufferName,int RequiresNullTerminator)
cdef LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char * InputData,size_t InputDataLength,const char * BufferName)
cdef const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
cdef size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
cdef void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
# Constructs a new whole-module pass pipeline. This type of pipeline is
# suitable for link-time optimization and whole-module transformations.
# @see llvm::PassManager::PassManager
cdef LLVMPassManagerRef LLVMCreatePassManager()
# Constructs a new function-by-function pass pipeline over the module
# provider. It does not take ownership of the module provider. This type of
# pipeline is suitable for code generation and JIT compilation tasks.
# @see llvm::FunctionPassManager::FunctionPassManager
cdef LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
# Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
cdef LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP)
# Initializes, executes on the provided module, and finalizes all of the
# passes scheduled in the pass manager. Returns 1 if any of the passes
# modified the module, 0 otherwise.
# @see llvm::PassManager::run(Module&)
cdef int LLVMRunPassManager(LLVMPassManagerRef PM,LLVMModuleRef M)
# Initializes all of the function passes scheduled in the function pass
# manager. Returns 1 if any of the passes modified the module, 0 otherwise.
# @see llvm::FunctionPassManager::doInitialization
cdef int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
# Executes all of the function passes scheduled in the function pass manager
# on the provided function. Returns 1 if any of the passes modified the
# function, false otherwise.
# @see llvm::FunctionPassManager::run(Function&)
cdef int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM,LLVMValueRef F)
# Finalizes all of the function passes scheduled in the function pass
# manager. Returns 1 if any of the passes modified the module, 0 otherwise.
# @see llvm::FunctionPassManager::doFinalization
cdef int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
# Frees the memory of a pass pipeline. For function pipelines, does not free
# the module provider.
# @see llvm::PassManagerBase::~PassManagerBase.
cdef void LLVMDisposePassManager(LLVMPassManagerRef PM)
# Deprecated: Multi-threading can only be enabled/disabled with the compile
# time define LLVM_ENABLE_THREADS. This function always returns
# LLVMIsMultithreaded().
cdef int LLVMStartMultithreaded()
# Deprecated: Multi-threading can only be enabled/disabled with the compile
# time define LLVM_ENABLE_THREADS.
cdef void LLVMStopMultithreaded()
# Check whether LLVM is executing in thread-safe mode or not.
# @see llvm::llvm_is_multithreaded
cdef int LLVMIsMultithreaded()
cdef bint __core_has_symbol(const char* name) noexcept nogil