module Llvm:Core API.sig
..end
This interface provides an ocaml API for the LLVM intermediate
representation, the classes in the VMCore library.
These abstract types correlate directly to the LLVM VMCore classes.
type
llmodule
llvm::Module
class.type
lltype
lltype
. See the
llvm::Type
class.type
lltypehandle
Llvm.refine_type
, lltype
values may
become invalid; use lltypehandle
to resolve this problem. See the
llvm::AbstractTypeHolder
class.type
llvalue
llvalues
. See the llvm::Value
class.
This type covers a wide range of subclasses.type
llbasicblock
llvm::BasicBlock
class.type
llbuilder
llvm::LLVMBuilder
class.type
llmoduleprovider
llvm::ModuleProvider
class.type
llmemorybuffer
llvm::MemoryBuffer
class.module TypeKind:sig
..end
lltype
, the result of classify_type ty
.
module Linkage:sig
..end
Llvm.linkage
and
Llvm.set_linkage
.
module Visibility:sig
..end
Llvm.visibility
and
Llvm.set_visibility
.
module CallConv:sig
..end
Llvm.function_call_conv
and Llvm.set_function_call_conv
.
module Icmp:sig
..end
icmp
) instruction.
module Fcmp:sig
..end
fcmp
) instruction.
type ('a, 'b)
llpos =
| |
At_end of |
| |
Before of |
Before b
and At_end a
specify positions from the start of the 'b
list
of a
. llpos
is used to specify positions in and for forward iteration
through the various value lists maintained by the LLVM IR.type ('a, 'b)
llrev_pos =
| |
At_start of |
| |
After of |
After b
and At_start a
specify positions from the end of the 'b
list
of a
. llrev_pos
is used for reverse iteration through the various value
lists maintained by the LLVM IR.exception IoError of string
val create_module : string -> llmodule
create_module id
creates a module with the supplied module ID. Modules are
not garbage collected; it is mandatory to call Llvm.dispose_module
to free
memory. See the constructor llvm::Module::Module
.val dispose_module : llmodule -> unit
dispose_module m
destroys a module m
and all of the IR objects it
contained. All references to subordinate objects are invalidated;
referencing them will invoke undefined behavior. See the destructor
llvm::Module::~Module
.val target_triple : llmodule -> string
target_triple m
is the target specifier for the module m
, something like
i686-apple-darwin8
. See the method llvm::Module::getTargetTriple
.val set_target_triple : string -> llmodule -> unit
target_triple triple m
changes the target specifier for the module m
to
the string triple
. See the method llvm::Module::setTargetTriple
.val data_layout : llmodule -> string
data_layout m
is the data layout specifier for the module m
, something
like e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-...-a0:0:64-f80:128:128
. See the
method llvm::Module::getDataLayout
.val set_data_layout : string -> llmodule -> unit
set_data_layout s m
changes the data layout specifier for the module m
to the string s
. See the method llvm::Module::setDataLayout
.val define_type_name : string -> lltype -> llmodule -> bool
define_type_name name ty m
adds a named type to the module's symbol table.
Returns true
if successful. If such a name already exists, then no entry
is added and false
is returned. See the llvm::Module::addTypeName
method.val delete_type_name : string -> llmodule -> unit
delete_type_name name
removes a type name from the module's symbol
table.val dump_module : llmodule -> unit
dump_module m
prints the .ll representation of the module m
to standard
error. See the method llvm::Module::dump
.val classify_type : lltype -> TypeKind.t
classify_type ty
returns the Llvm.TypeKind.t
corresponding to the type ty
.
See the method llvm::Type::getTypeID
.val string_of_lltype : lltype -> string
string_of_lltype ty
returns a string describing the type ty
.val i1_type : lltype
llvm::Type::Int1Ty
.val i8_type : lltype
llvm::Type::Int8Ty
.val i16_type : lltype
llvm::Type::Int16Ty
.val i32_type : lltype
llvm::Type::Int32Ty
.val i64_type : lltype
llvm::Type::Int64Ty
.val integer_type : int -> lltype
integer_type n
returns an integer type of bitwidth n
.
See the method llvm::IntegerType::get
.val integer_bitwidth : lltype -> int
integer_bitwidth ty
returns the number of bits in the integer type ty
.
See the method llvm::IntegerType::getBitWidth
.val float_type : lltype
llvm::Type::FloatTy
.val double_type : lltype
llvm::Type::DoubleTy
.val x86fp80_type : lltype
llvm::Type::X86_FP80Ty
.val fp128_type : lltype
llvm::Type::FP128Ty
.val ppc_fp128_type : lltype
llvm::Type::PPC_FP128Ty
.val function_type : lltype -> lltype array -> lltype
function_type ret_ty param_tys
returns the function type returning
ret_ty
and taking param_tys
as parameters.
See the method llvm::FunctionType::get
.val var_arg_function_type : lltype -> lltype array -> lltype
va_arg_function_type ret_ty param_tys
is just like
function_type ret_ty param_tys
except that it returns the function type
which also takes a variable number of arguments.
See the method llvm::FunctionType::get
.val is_var_arg : lltype -> bool
is_var_arg fty
returns true
if fty
is a varargs function type, false
otherwise. See the method llvm::FunctionType::isVarArg
.val return_type : lltype -> lltype
return_type fty
gets the return type of the function type fty
.
See the method llvm::FunctionType::getReturnType
.val param_types : lltype -> lltype array
param_types fty
gets the parameter types of the function type fty
.
See the method llvm::FunctionType::getParamType
.val struct_type : lltype array -> lltype
struct_type tys
returns the structure type containing in the types in the
array tys
. See the method llvm::StructType::get
.val packed_struct_type : lltype array -> lltype
struct_type tys
returns the packed structure type containing in the types
in the array tys
. See the method llvm::StructType::get
.val element_types : lltype -> lltype array
element_types sty
returns the constituent types of the struct type sty
.
See the method llvm::StructType::getElementType
.val is_packed : lltype -> bool
is_packed sty
returns true
if the structure type sty
is packed,
false
otherwise. See the method llvm::StructType::isPacked
.val array_type : lltype -> int -> lltype
array_type ty n
returns the array type containing n
elements of type
ty
. See the method llvm::ArrayType::get
.val pointer_type : lltype -> lltype
pointer_type ty
returns the pointer type referencing objects of type
ty
in the default address space (0).
See the method llvm::PointerType::getUnqual
.val qualified_pointer_type : lltype -> int -> lltype
qualified_pointer_type ty as
returns the pointer type referencing objects
of type ty
in address space as
.
See the method llvm::PointerType::get
.val vector_type : lltype -> int -> lltype
vector_type ty n
returns the array type containing n
elements of the
primitive type ty
. See the method llvm::ArrayType::get
.val element_type : lltype -> lltype
element_type ty
returns the element type of the pointer, vector, or array
type ty
. See the method llvm::SequentialType::get
.val array_length : lltype -> int
element_type aty
returns the element count of the array type aty
.
See the method llvm::ArrayType::getNumElements
.val address_space : lltype -> int
address_space pty
returns the address space qualifier of the pointer type
pty
. See the method llvm::PointerType::getAddressSpace
.val vector_size : lltype -> int
element_type ty
returns the element count of the vector type ty
.
See the method llvm::VectorType::getNumElements
.val opaque_type : unit -> lltype
opaque_type ()
creates a new opaque type distinct from any other.
Opaque types are useful for building recursive types in combination with
Llvm.refine_type
.
See llvm::OpaqueType::get
.val void_type : lltype
void_type
is the type of a function which does not return any value.
See llvm::Type::VoidTy
.val label_type : lltype
label_type
is the type of a basic block. See llvm::Type::LabelTy
.val handle_to_type : lltype -> lltypehandle
handle_to_type ty
creates a handle to the type ty
. If ty
is later
refined as a result of a call to Llvm.refine_type
, the handle will be updated;
any bare lltype
references will become invalid.
See the class llvm::PATypeHolder
.val type_of_handle : lltypehandle -> lltype
type_of_handle tyh
resolves the type handle tyh
.
See the method llvm::PATypeHolder::get()
.val refine_type : lltype -> lltype -> unit
refine_type opaque_ty ty
replaces the abstract type opaque_ty
with the
concrete type ty
in all users. Warning: This may invalidate Llvm.lltype
values! Use Llvm.lltypehandle
to manipulate potentially abstract types. See
the method llvm::Type::refineAbstractType
.val type_of : llvalue -> lltype
type_of v
returns the type of the value v
.
See the method llvm::Value::getType
.val value_name : llvalue -> string
value_name v
returns the name of the value v
. For global values, this is
the symbol name. For instructions and basic blocks, it is the SSA register
name. It is meaningless for constants.
See the method llvm::Value::getName
.val set_value_name : string -> llvalue -> unit
set_value_name n v
sets the name of the value v
to n
. See the method
llvm::Value::setName
.val dump_value : llvalue -> unit
dump_value v
prints the .ll representation of the value v
to standard
error. See the method llvm::Value::dump
.val is_constant : llvalue -> bool
is_constant v
returns true
if the value v
is a constant, false
otherwise. Similar to llvm::isa<Constant>
.val const_null : lltype -> llvalue
const_null ty
returns the constant null (zero) of the type ty
.
See the method llvm::Constant::getNullValue
.val const_all_ones : lltype -> llvalue
const_all_ones ty
returns the constant '-1' of the integer or vector type
ty
. See the method llvm::Constant::getAllOnesValue
.val undef : lltype -> llvalue
undef ty
returns the undefined value of the type ty
.
See the method llvm::UndefValue::get
.val is_null : llvalue -> bool
is_null v
returns true
if the value v
is the null (zero) value.
See the method llvm::Constant::isNullValue
.val is_undef : llvalue -> bool
is_undef v
returns true
if the value v
is an undefined value, false
otherwise. Similar to llvm::isa<UndefValue>
.val const_int : lltype -> int -> llvalue
const_int ty i
returns the integer constant of type ty
and value i
.
See the method llvm::ConstantInt::get
.val const_of_int64 : lltype -> Int64.t -> bool -> llvalue
const_of_int64 ty i
returns the integer constant of type ty
and value
i
. See the method llvm::ConstantInt::get
.val const_float : lltype -> float -> llvalue
const_float ty n
returns the floating point constant of type ty
and
value n
. See the method llvm::ConstantInt::get
.val const_string : string -> llvalue
const_string s
returns the constant i8
array with the values of the
characters in the string s
. The array is not null-terminated (but see
Llvm.const_stringz
). This value can in turn be used as the initializer for a
global variable. See the method llvm::ConstantArray::get
.val const_stringz : string -> llvalue
const_stringz s
returns the constant i8
array with the values of the
characters in the string s
and a null terminator. This value can in turn
be used as the initializer for a global variable.
See the method llvm::ConstantArray::get
.val const_array : lltype -> llvalue array -> llvalue
const_array ty elts
returns the constant array of type
array_type ty (Array.length elts)
and containing the values elts
.
This value can in turn be used as the initializer for a global variable.
See the method llvm::ConstantArray::get
.val const_struct : llvalue array -> llvalue
const_struct elts
returns the structured constant of type
struct_type (Array.map type_of elts)
and containing the values elts
.
This value can in turn be used as the initializer for a global variable.
See the method llvm::ConstantStruct::get
.val const_packed_struct : llvalue array -> llvalue
const_packed_struct elts
returns the structured constant of type
Llvm.packed_struct_type
(Array.map type_of elts)
and containing the values
elts
. This value can in turn be used as the initializer for a global
variable. See the method llvm::ConstantStruct::get
.val const_vector : llvalue array -> llvalue
const_vector elts
returns the vector constant of type
vector_type (type_of elts.(0)) (Array.length elts)
and containing the
values elts
. See the method llvm::ConstantVector::get
.val size_of : lltype -> llvalue
size_of ty
returns the sizeof constant for the type ty
. This is
equivalent to const_ptrtoint (const_gep (const_null (pointer_type ty))
(const_int i64_type 1)) i64_type
, but considerably more readable.
See the method llvm::ConstantExpr::getSizeOf
.val const_neg : llvalue -> llvalue
const_neg c
returns the arithmetic negation of the constant c
.
See the method llvm::ConstantExpr::getNeg
.val const_not : llvalue -> llvalue
const_not c
returns the bitwise inverse of the constant c
.
See the method llvm::ConstantExpr::getNot
.val const_add : llvalue -> llvalue -> llvalue
const_add c1 c2
returns the constant sum of two constants.
See the method llvm::ConstantExpr::getAdd
.val const_sub : llvalue -> llvalue -> llvalue
const_sub c1 c2
returns the constant difference, c1 - c2
, of two
constants. See the method llvm::ConstantExpr::getSub
.val const_mul : llvalue -> llvalue -> llvalue
const_mul c1 c2
returns the constant product of two constants.
See the method llvm::ConstantExpr::getMul
.val const_udiv : llvalue -> llvalue -> llvalue
const_udiv c1 c2
returns the constant quotient c1 / c2
of two unsigned
integer constants.
See the method llvm::ConstantExpr::getUDiv
.val const_sdiv : llvalue -> llvalue -> llvalue
const_sdiv c1 c2
returns the constant quotient c1 / c2
of two signed
integer constants.
See the method llvm::ConstantExpr::
.val const_fdiv : llvalue -> llvalue -> llvalue
const_fdiv c1 c2
returns the constant quotient c1 / c2
of two floating
point constants.
See the method llvm::ConstantExpr::getFDiv
.val const_urem : llvalue -> llvalue -> llvalue
const_udiv c1 c2
returns the constant remainder c1 MOD c2
of two
unsigned integer constants.
See the method llvm::ConstantExpr::getURem
.val const_srem : llvalue -> llvalue -> llvalue
const_sdiv c1 c2
returns the constant remainder c1 MOD c2
of two
signed integer constants.
See the method llvm::ConstantExpr::getSRem
.val const_frem : llvalue -> llvalue -> llvalue
const_frem c1 c2
returns the constant remainder c1 MOD c2
of two
signed floating point constants.
See the method llvm::ConstantExpr::getFRem
.val const_and : llvalue -> llvalue -> llvalue
const_and c1 c2
returns the constant bitwise AND
of two integer
constants.
See the method llvm::ConstantExpr::getAnd
.val const_or : llvalue -> llvalue -> llvalue
const_or c1 c2
returns the constant bitwise OR
of two integer
constants.
See the method llvm::ConstantExpr::getOr
.val const_xor : llvalue -> llvalue -> llvalue
const_xor c1 c2
returns the constant bitwise XOR
of two integer
constants.
See the method llvm::ConstantExpr::getXor
.val const_icmp : Icmp.t -> llvalue -> llvalue -> llvalue
const_icmp pred c1 c2
returns the constant comparison of two integer
constants, c1 pred c2
.
See the method llvm::ConstantExpr::getICmp
.val const_fcmp : Fcmp.t -> llvalue -> llvalue -> llvalue
const_fcmp pred c1 c2
returns the constant comparison of two floating
point constants, c1 pred c2
.
See the method llvm::ConstantExpr::getFCmp
.val const_shl : llvalue -> llvalue -> llvalue
const_shl c1 c2
returns the constant integer c1
left-shifted by the
constant integer c2
.
See the method llvm::ConstantExpr::getShl
.val const_lshr : llvalue -> llvalue -> llvalue
const_lshr c1 c2
returns the constant integer c1
right-shifted by the
constant integer c2
with zero extension.
See the method llvm::ConstantExpr::getLShr
.val const_ashr : llvalue -> llvalue -> llvalue
const_ashr c1 c2
returns the constant integer c1
right-shifted by the
constant integer c2
with sign extension.
See the method llvm::ConstantExpr::getAShr
.val const_gep : llvalue -> llvalue array -> llvalue
const_gep pc indices
returns the constant getElementPtr
of p1
with the
constant integers indices from the array indices
.
See the method llvm::ConstantExpr::getGetElementPtr
.val const_trunc : llvalue -> lltype -> llvalue
const_trunc c ty
returns the constant truncation of integer constant c
to the smaller integer type ty
.
See the method llvm::ConstantExpr::getTrunc
.val const_sext : llvalue -> lltype -> llvalue
const_sext c ty
returns the constant sign extension of integer constant
c
to the larger integer type ty
.
See the method llvm::ConstantExpr::getSExt
.val const_zext : llvalue -> lltype -> llvalue
const_zext c ty
returns the constant zero extension of integer constant
c
to the larger integer type ty
.
See the method llvm::ConstantExpr::getZExt
.val const_fptrunc : llvalue -> lltype -> llvalue
const_fptrunc c ty
returns the constant truncation of floating point
constant c
to the smaller floating point type ty
.
See the method llvm::ConstantExpr::getFPTrunc
.val const_fpext : llvalue -> lltype -> llvalue
const_fpext c ty
returns the constant extension of floating point constant
c
to the larger floating point type ty
.
See the method llvm::ConstantExpr::getFPExt
.val const_uitofp : llvalue -> lltype -> llvalue
const_uitofp c ty
returns the constant floating point conversion of
unsigned integer constant c
to the floating point type ty
.
See the method llvm::ConstantExpr::getUIToFP
.val const_sitofp : llvalue -> lltype -> llvalue
const_sitofp c ty
returns the constant floating point conversion of
signed integer constant c
to the floating point type ty
.
See the method llvm::ConstantExpr::getSIToFP
.val const_fptoui : llvalue -> lltype -> llvalue
const_fptoui c ty
returns the constant unsigned integer conversion of
floating point constant c
to integer type ty
.
See the method llvm::ConstantExpr::getFPToUI
.val const_fptosi : llvalue -> lltype -> llvalue
const_fptoui c ty
returns the constant unsigned integer conversion of
floating point constant c
to integer type ty
.
See the method llvm::ConstantExpr::getFPToSI
.val const_ptrtoint : llvalue -> lltype -> llvalue
const_ptrtoint c ty
returns the constant integer conversion of
pointer constant c
to integer type ty
.
See the method llvm::ConstantExpr::getPtrToInt
.val const_inttoptr : llvalue -> lltype -> llvalue
const_inttoptr c ty
returns the constant pointer conversion of
integer constant c
to pointer type ty
.
See the method llvm::ConstantExpr::getIntToPtr
.val const_bitcast : llvalue -> lltype -> llvalue
const_bitcast c ty
returns the constant bitwise conversion of constant c
to type ty
of equal size.
See the method llvm::ConstantExpr::getBitCast
.val const_select : llvalue -> llvalue -> llvalue -> llvalue
const_select cond t f
returns the constant conditional which returns value
t
if the boolean constant cond
is true and the value f
otherwise.
See the method llvm::ConstantExpr::getSelect
.val const_extractelement : llvalue -> llvalue -> llvalue
const_extractelement vec i
returns the constant i
th element of
constant vector vec
. i
must be a constant i32
value unsigned less than
the size of the vector.
See the method llvm::ConstantExpr::getExtractElement
.val const_insertelement : llvalue -> llvalue -> llvalue -> llvalue
const_insertelement vec v i
returns the constant vector with the same
elements as constant vector v
but the i
th element replaced by the
constant v
. v
must be a constant value with the type of the vector
elements. i
must be a constant i32
value unsigned less than the size
of the vector.
See the method llvm::ConstantExpr::getInsertElement
.val const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue
const_shufflevector a b mask
returns a constant shufflevector
.
See the LLVM Language Reference for details on the sufflevector
instruction.
See the method llvm::ConstantExpr::getShuffleVector
.val global_parent : llvalue -> llmodule
global_parent g
is the enclosing module of the global value g
.
See the method llvm::GlobalValue::getParent
.val is_declaration : llvalue -> bool
is_declaration g
returns true
if the global value g
is a declaration
only. Returns false
otherwise.
See the method llvm::GlobalValue::isDeclaration
.val linkage : llvalue -> Linkage.t
linkage g
returns the linkage of the global value g
.
See the method llvm::GlobalValue::getLinkage
.val set_linkage : Linkage.t -> llvalue -> unit
set_linkage l g
sets the linkage of the global value g
to l
.
See the method llvm::GlobalValue::setLinkage
.val section : llvalue -> string
section g
returns the linker section of the global value g
.
See the method llvm::GlobalValue::getSection
.val set_section : string -> llvalue -> unit
set_section s g
sets the linker section of the global value g
to s
.
See the method llvm::GlobalValue::setSection
.val visibility : llvalue -> Visibility.t
visibility g
returns the linker visibility of the global value g
.
See the method llvm::GlobalValue::getVisibility
.val set_visibility : Visibility.t -> llvalue -> unit
set_visibility v g
sets the linker visibility of the global value g
to
v
. See the method llvm::GlobalValue::setVisibility
.val alignment : llvalue -> int
alignment g
returns the required alignment of the global value g
.
See the method llvm::GlobalValue::getAlignment
.val set_alignment : int -> llvalue -> unit
set_alignment n g
sets the required alignment of the global value g
to
n
bytes. See the method llvm::GlobalValue::setAlignment
.val declare_global : lltype -> string -> llmodule -> llvalue
declare_global ty name m
returns a new global variable of type ty
and
with name name
in module m
. If such a global variable already exists,
it is returned. If the type of the existing global differs, then a bitcast
to ty
is returned.val define_global : string -> llvalue -> llmodule -> llvalue
define_global name init m
returns a new global with name name
and
initializer init
in module m
. If the named global already exists, it is
renamed.
See the constructor of llvm::GlobalVariable
.val lookup_global : string -> llmodule -> llvalue option
lookup_global name m
returns Some g
if a global variable with name
name
exists in module m
. If no such global exists, returns None
.
See the llvm::GlobalVariable
constructor.val delete_global : llvalue -> unit
delete_global gv
destroys the global variable gv
.
See the method llvm::GlobalVariable::eraseFromParent
.val global_begin : llmodule -> (llmodule, llvalue) llpos
global_begin m
returns the first position in the global variable list of
the module m
. global_begin
and global_succ
can be used to iterate
over the global list in order.
See the method llvm::Module::global_begin
.val global_succ : llvalue -> (llmodule, llvalue) llpos
global_succ gv
returns the global variable list position succeeding
Before gv
.
See the method llvm::Module::global_iterator::operator++
.val iter_globals : (llvalue -> unit) -> llmodule -> unit
iter_globals f m
applies function f
to each of the global variables of
module m
in order. Tail recursive.val fold_left_globals : ('a -> llvalue -> 'a) -> 'a -> llmodule -> 'a
fold_left_globals f init m
is f (... (f init g1) ...) gN
where
g1,...,gN
are the global variables of module m
. Tail recursive.val global_end : llmodule -> (llmodule, llvalue) llrev_pos
global_end m
returns the last position in the global variable list of the
module m
. global_end
and global_pred
can be used to iterate over the
global list in reverse.
See the method llvm::Module::global_end
.val global_pred : llvalue -> (llmodule, llvalue) llrev_pos
global_pred gv
returns the global variable list position preceding
After gv
.
See the method llvm::Module::global_iterator::operator--
.val rev_iter_globals : (llvalue -> unit) -> llmodule -> unit
rev_iter_globals f m
applies function f
to each of the global variables
of module m
in reverse order. Tail recursive.val fold_right_globals : (llvalue -> 'a -> 'a) -> llmodule -> 'a -> 'a
fold_right_globals f m init
is f g1 (... (f gN init) ...)
where
g1,...,gN
are the global variables of module m
. Tail recursive.val is_global_constant : llvalue -> bool
is_global_constant gv
returns true
if the global variabile gv
is a
constant. Returns false
otherwise.
See the method llvm::GlobalVariable::isConstant
.val set_global_constant : bool -> llvalue -> unit
set_global_constant c gv
sets the global variable gv
to be a constant if
c
is true
and not if c
is false
.
See the method llvm::GlobalVariable::setConstant
.val global_initializer : llvalue -> llvalue
global_initializer gv
returns the initializer for the global variable
gv
. See the method llvm::GlobalVariable::getInitializer
.val set_initializer : llvalue -> llvalue -> unit
set_initializer c gv
sets the initializer for the global variable
gv
to the constant c
.
See the method llvm::GlobalVariable::setInitializer
.val remove_initializer : llvalue -> unit
remove_initializer gv
unsets the initializer for the global variable
gv
.
See the method llvm::GlobalVariable::setInitializer
.val is_thread_local : llvalue -> bool
is_thread_local gv
returns true
if the global variable gv
is
thread-local and false
otherwise.
See the method llvm::GlobalVariable::isThreadLocal
.val set_thread_local : bool -> llvalue -> unit
set_thread_local c gv
sets the global variable gv
to be thread local if
c
is true
and not otherwise.
See the method llvm::GlobalVariable::setThreadLocal
.val declare_function : string -> lltype -> llmodule -> llvalue
declare_function name ty m
returns a new function of type ty
and
with name name
in module m
. If such a function already exists,
it is returned. If the type of the existing function differs, then a bitcast
to ty
is returned.val define_function : string -> lltype -> llmodule -> llvalue
define_function name ty m
creates a new function with name name
and
type ty
in module m
. If the named function already exists, it is
renamed. An entry basic block is created in the function.
See the constructor of llvm::GlobalVariable
.val lookup_function : string -> llmodule -> llvalue option
lookup_function name m
returns Some f
if a function with name
name
exists in module m
. If no such function exists, returns None
.
See the method llvm::Module
constructor.val delete_function : llvalue -> unit
delete_function f
destroys the function f
.
See the method llvm::Function::eraseFromParent
.val function_begin : llmodule -> (llmodule, llvalue) llpos
function_begin m
returns the first position in the function list of the
module m
. function_begin
and function_succ
can be used to iterate over
the function list in order.
See the method llvm::Module::begin
.val function_succ : llvalue -> (llmodule, llvalue) llpos
function_succ gv
returns the function list position succeeding
Before gv
.
See the method llvm::Module::iterator::operator++
.val iter_functions : (llvalue -> unit) -> llmodule -> unit
iter_functions f m
applies function f
to each of the functions of module
m
in order. Tail recursive.val fold_left_functions : ('a -> llvalue -> 'a) -> 'a -> llmodule -> 'a
fold_left_function f init m
is f (... (f init f1) ...) fN
where
f1,...,fN
are the functions of module m
. Tail recursive.val function_end : llmodule -> (llmodule, llvalue) llrev_pos
function_end m
returns the last position in the function list of
the module m
. function_end
and function_pred
can be used to iterate
over the function list in reverse.
See the method llvm::Module::end
.val function_pred : llvalue -> (llmodule, llvalue) llrev_pos
function_pred gv
returns the function list position preceding After gv
.
See the method llvm::Module::iterator::operator--
.val rev_iter_functions : (llvalue -> unit) -> llmodule -> unit
rev_iter_functions f fn
applies function f
to each of the functions of
module m
in reverse order. Tail recursive.val fold_right_functions : (llvalue -> 'a -> 'a) -> llmodule -> 'a -> 'a
fold_right_functions f m init
is f (... (f init fN) ...) f1
where
f1,...,fN
are the functions of module m
. Tail recursive.val is_intrinsic : llvalue -> bool
is_intrinsic f
returns true if the function f
is an intrinsic.
See the method llvm::Function::isIntrinsic
.val function_call_conv : llvalue -> int
function_call_conv f
returns the calling convention of the function f
.
See the method llvm::Function::getCallingConv
.val set_function_call_conv : int -> llvalue -> unit
set_function_call_conv cc f
sets the calling convention of the function
f
to the calling convention numbered cc
.
See the method llvm::Function::setCallingConv
.val gc : llvalue -> string option
gc f
returns Some name
if the function f
has a garbage
collection algorithm specified and None
otherwise.
See the method llvm::Function::getGC
.val set_gc : string option -> llvalue -> unit
set_gc gc f
sets the collection algorithm for the function f
to
gc
. See the method llvm::Function::setGC
.val params : llvalue -> llvalue array
params f
returns the parameters of function f
.
See the method llvm::Function::getArgumentList
.val param : llvalue -> int -> llvalue
param f n
returns the n
th parameter of function f
.
See the method llvm::Function::getArgumentList
.val param_parent : llvalue -> llvalue
param_parent p
returns the parent function that owns the parameter.
See the method llvm::Argument::getParent
.val param_begin : llvalue -> (llvalue, llvalue) llpos
param_begin f
returns the first position in the parameter list of the
function f
. param_begin
and param_succ
can be used to iterate over
the parameter list in order.
See the method llvm::Function::arg_begin
.val param_succ : llvalue -> (llvalue, llvalue) llpos
param_succ bb
returns the parameter list position succeeding
Before bb
.
See the method llvm::Function::arg_iterator::operator++
.val iter_params : (llvalue -> unit) -> llvalue -> unit
iter_params f fn
applies function f
to each of the parameters
of function fn
in order. Tail recursive.val fold_left_params : ('a -> llvalue -> 'a) -> 'a -> llvalue -> 'a
fold_left_params f init fn
is f (... (f init b1) ...) bN
where
b1,...,bN
are the parameters of function fn
. Tail recursive.val param_end : llvalue -> (llvalue, llvalue) llrev_pos
param_end f
returns the last position in the parameter list of
the function f
. param_end
and param_pred
can be used to iterate
over the parameter list in reverse.
See the method llvm::Function::arg_end
.val param_pred : llvalue -> (llvalue, llvalue) llrev_pos
param_pred gv
returns the function list position preceding After gv
.
See the method llvm::Function::arg_iterator::operator--
.val rev_iter_params : (llvalue -> unit) -> llvalue -> unit
rev_iter_params f fn
applies function f
to each of the parameters
of function fn
in reverse order. Tail recursive.val fold_right_params : (llvalue -> 'a -> 'a) -> llvalue -> 'a -> 'a
fold_right_params f fn init
is f (... (f init bN) ...) b1
where
b1,...,bN
are the parameters of function fn
. Tail recursive.val basic_blocks : llvalue -> llbasicblock array
basic_blocks fn
returns the basic blocks of the function f
.
See the method llvm::Function::getBasicBlockList
.val entry_block : llvalue -> llbasicblock
entry_block fn
returns the entry basic block of the function f
.
See the method llvm::Function::getEntryBlock
.val delete_block : llbasicblock -> unit
delete_block bb
deletes the basic block bb
.
See the method llvm::BasicBlock::eraseFromParent
.val append_block : string -> llvalue -> llbasicblock
append_block name f
creates a new basic block named name
at the end of
function f
.
See the constructor of llvm::BasicBlock
.val insert_block : string -> llbasicblock -> llbasicblock
insert_block name bb
creates a new basic block named name
before the
basic block bb
.
See the constructor of llvm::BasicBlock
.val block_parent : llbasicblock -> llvalue
block_parent bb
returns the parent function that owns the basic block.
See the method llvm::BasicBlock::getParent
.val block_begin : llvalue -> (llvalue, llbasicblock) llpos
block_begin f
returns the first position in the basic block list of the
function f
. block_begin
and block_succ
can be used to iterate over
the basic block list in order.
See the method llvm::Function::begin
.val block_succ : llbasicblock -> (llvalue, llbasicblock) llpos
block_succ bb
returns the basic block list position succeeding
Before bb
.
See the method llvm::Function::iterator::operator++
.val iter_blocks : (llbasicblock -> unit) -> llvalue -> unit
iter_blocks f fn
applies function f
to each of the basic blocks
of function fn
in order. Tail recursive.val fold_left_blocks : ('a -> llbasicblock -> 'a) -> 'a -> llvalue -> 'a
fold_left_blocks f init fn
is f (... (f init b1) ...) bN
where
b1,...,bN
are the basic blocks of function fn
. Tail recursive.val block_end : llvalue -> (llvalue, llbasicblock) llrev_pos
block_end f
returns the last position in the basic block list of
the function f
. block_end
and block_pred
can be used to iterate
over the basic block list in reverse.
See the method llvm::Function::end
.val block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos
block_pred gv
returns the function list position preceding After gv
.
See the method llvm::Function::iterator::operator--
.val rev_iter_blocks : (llbasicblock -> unit) -> llvalue -> unit
rev_iter_blocks f fn
applies function f
to each of the basic blocks
of function fn
in reverse order. Tail recursive.val fold_right_blocks : (llbasicblock -> 'a -> 'a) -> llvalue -> 'a -> 'a
fold_right_blocks f fn init
is f (... (f init bN) ...) b1
where
b1,...,bN
are the basic blocks of function fn
. Tail recursive.val value_of_block : llbasicblock -> llvalue
value_of_block bb
losslessly casts bb
to an llvalue
.val value_is_block : llvalue -> bool
value_is_block v
returns true
if the value v
is a basic block and
false
otherwise.
Similar to llvm::isa<BasicBlock>
.val block_of_value : llvalue -> llbasicblock
block_of_value v
losslessly casts v
to an llbasicblock
.val instr_parent : llvalue -> llbasicblock
instr_parent i
is the enclosing basic block of the instruction i
.
See the method llvm::Instruction::getParent
.val instr_begin : llbasicblock -> (llbasicblock, llvalue) llpos
instr_begin bb
returns the first position in the instruction list of the
basic block bb
. instr_begin
and instr_succ
can be used to iterate over
the instruction list in order.
See the method llvm::BasicBlock::begin
.val instr_succ : llvalue -> (llbasicblock, llvalue) llpos
instr_succ i
returns the instruction list position succeeding Before i
.
See the method llvm::BasicBlock::iterator::operator++
.val iter_instrs : (llvalue -> unit) -> llbasicblock -> unit
iter_instrs f bb
applies function f
to each of the instructions of basic
block bb
in order. Tail recursive.val fold_left_instrs : ('a -> llvalue -> 'a) -> 'a -> llbasicblock -> 'a
fold_left_instrs f init bb
is f (... (f init g1) ...) gN
where
g1,...,gN
are the instructions of basic block bb
. Tail recursive.val instr_end : llbasicblock -> (llbasicblock, llvalue) llrev_pos
instr_end bb
returns the last position in the instruction list of the
basic block bb
. instr_end
and instr_pred
can be used to iterate over
the instruction list in reverse.
See the method llvm::BasicBlock::end
.val instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos
instr_pred i
returns the instruction list position preceding After i
.
See the method llvm::BasicBlock::iterator::operator--
.val fold_right_instrs : (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a
fold_right_instrs f bb init
is f (... (f init fN) ...) f1
where
f1,...,fN
are the instructions of basic block bb
. Tail recursive.val instruction_call_conv : llvalue -> int
instruction_call_conv ci
is the calling convention for the call or invoke
instruction ci
, which may be one of the values from the module
Llvm.CallConv
. See the method llvm::CallInst::getCallingConv
and
llvm::InvokeInst::getCallingConv
.val set_instruction_call_conv : int -> llvalue -> unit
set_instruction_call_conv cc ci
sets the calling convention for the call
or invoke instruction ci
to the integer cc
, which can be one of the
values from the module Llvm.CallConv
.
See the method llvm::CallInst::setCallingConv
and llvm::InvokeInst::setCallingConv
.val is_tail_call : llvalue -> bool
is_tail_call ci
is true
if the call instruction ci
is flagged as
eligible for tail call optimization, false
otherwise.
See the method llvm::CallInst::isTailCall
.val set_tail_call : bool -> llvalue -> unit
set_tail_call tc ci
flags the call instruction ci
as eligible for tail
call optimization if tc
is true
, clears otherwise.
See the method llvm::CallInst::setTailCall
.val add_incoming : llvalue * llbasicblock -> llvalue -> unit
add_incoming (v, bb) pn
adds the value v
to the phi node pn
for use
with branches from bb
. See the method llvm::PHINode::addIncoming
.val incoming : llvalue -> (llvalue * llbasicblock) list
incoming pn
returns the list of value-block pairs for phi node pn
.
See the method llvm::PHINode::getIncomingValue
.val builder : unit -> llbuilder
builder ()
creates an instruction builder with no position. It is invalid
to use this builder until its position is set with Llvm.position_before
or
Llvm.position_at_end
. See the constructor for llvm::LLVMBuilder
.val builder_at : (llbasicblock, llvalue) llpos -> llbuilder
builder_at ip
creates an instruction builder positioned at ip
.
See the constructor for llvm::LLVMBuilder
.val builder_before : llvalue -> llbuilder
builder_before ins
creates an instruction builder positioned before the
instruction isn
. See the constructor for llvm::LLVMBuilder
.val builder_at_end : llbasicblock -> llbuilder
builder_at_end bb
creates an instruction builder positioned at the end of
the basic block bb
. See the constructor for llvm::LLVMBuilder
.val position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit
position_builder ip bb
moves the instruction builder bb
to the position
ip
.
See the constructor for llvm::LLVMBuilder
.val position_before : llvalue -> llbuilder -> unit
position_before ins b
moves the instruction builder b
to before the
instruction isn
. See the method llvm::LLVMBuilder::SetInsertPoint
.val position_at_end : llbasicblock -> llbuilder -> unit
position_at_end bb b
moves the instruction builder b
to the end of the
basic block bb
. See the method llvm::LLVMBuilder::SetInsertPoint
.val insertion_block : llbuilder -> llbasicblock
insertion_block b
returns the basic block that the builder b
is
positioned to insert into. Raises Not_Found
if the instruction builder is
uninitialized.
See the method llvm::LLVMBuilder::GetInsertBlock
.val build_ret_void : llbuilder -> llvalue
build_ret_void b
creates a
ret void
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateRetVoid
.val build_ret : llvalue -> llbuilder -> llvalue
build_ret v b
creates a
ret %v
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateRet
.val build_br : llbasicblock -> llbuilder -> llvalue
build_br bb b
creates a
b %bb
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateBr
.val build_cond_br : llvalue ->
llbasicblock -> llbasicblock -> llbuilder -> llvalue
build_cond_br cond tbb fbb b
creates a
b %cond, %tbb, %fbb
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateCondBr
.val build_switch : llvalue -> llbasicblock -> int -> llbuilder -> llvalue
build_switch case elsebb count b
creates an empty
switch %case, %elsebb
instruction at the position specified by the instruction builder b
with
space reserved for count
cases.
See the method llvm::LLVMBuilder::CreateSwitch
.val add_case : llvalue -> llvalue -> llbasicblock -> unit
add_case sw onval bb
causes switch instruction sw
to branch to bb
when its input matches the constant onval
.
See the method llvm::SwitchInst::addCase
. *val build_invoke : llvalue ->
llvalue array ->
llbasicblock ->
llbasicblock -> string -> llbuilder -> llvalue
build_invoke fn args tobb unwindbb name b
creates an
%name = invoke %fn(args) to %tobb unwind %unwindbb
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateInvoke
.val build_unwind : llbuilder -> llvalue
build_unwind b
creates an
unwind
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateUnwind
.val build_unreachable : llbuilder -> llvalue
build_unreachable b
creates an
unreachable
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateUnwind
.val build_add : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_add x y name b
creates a
%name = add %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateAdd
.val build_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_sub x y name b
creates a
%name = sub %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateSub
.val build_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_mul x y name b
creates a
%name = mul %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateMul
.val build_udiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_udiv x y name b
creates a
%name = udiv %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateUDiv
.val build_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_sdiv x y name b
creates a
%name = sdiv %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateSDiv
.val build_fdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_fdiv x y name b
creates a
%name = fdiv %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFDiv
.val build_urem : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_urem x y name b
creates a
%name = urem %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateURem
.val build_srem : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_SRem x y name b
creates a
%name = srem %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateSRem
.val build_frem : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_frem x y name b
creates a
%name = frem %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFRem
.val build_shl : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_shl x y name b
creates a
%name = shl %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateShl
.val build_lshr : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_lshr x y name b
creates a
%name = lshr %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateLShr
.val build_ashr : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_ashr x y name b
creates a
%name = ashr %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateAShr
.val build_and : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_and x y name b
creates a
%name = and %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateAnd
.val build_or : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_or x y name b
creates a
%name = or %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateOr
.val build_xor : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_xor x y name b
creates a
%name = xor %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateXor
.val build_neg : llvalue -> string -> llbuilder -> llvalue
build_neg x name b
creates a
%name = sub 0, %x
instruction at the position specified by the instruction builder b
.
-0.0
is used for floating point types to compute the correct sign.
See the method llvm::LLVMBuilder::CreateNeg
.val build_not : llvalue -> string -> llbuilder -> llvalue
build_xor x name b
creates a
%name = xor %x, -1
instruction at the position specified by the instruction builder b
.
-1
is the correct "all ones" value for the type of x
.
See the method llvm::LLVMBuilder::CreateXor
.val build_malloc : lltype -> string -> llbuilder -> llvalue
build_malloc ty name b
creates a
%name = malloc %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateAlloca
.val build_array_malloc : lltype -> llvalue -> string -> llbuilder -> llvalue
build_array_malloc ty n name b
creates a
%name = malloc %ty, %n
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateMalloc
.val build_alloca : lltype -> string -> llbuilder -> llvalue
build_alloca ty name b
creates a
%name = alloca %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateAlloca
.val build_array_alloca : lltype -> llvalue -> string -> llbuilder -> llvalue
build_array_alloca ty n name b
creates a
%name = alloca %ty, %n
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateAlloca
.val build_free : llvalue -> llbuilder -> llvalue
build_free v b
creates a
free %v
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFree
.val build_load : llvalue -> string -> llbuilder -> llvalue
build_load v name b
creates a
%name = load %v
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateLoad
.val build_store : llvalue -> llvalue -> llbuilder -> llvalue
build_store v p b
creates a
store %v, %p
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateStore
.val build_gep : llvalue ->
llvalue array -> string -> llbuilder -> llvalue
build_gep p indices name b
creates a
%name = gep %p, indices...
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateGetElementPtr
.val build_trunc : llvalue -> lltype -> string -> llbuilder -> llvalue
build_trunc v ty name b
creates a
%name = trunc %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateTrunc
.val build_zext : llvalue -> lltype -> string -> llbuilder -> llvalue
build_zext v ty name b
creates a
%name = zext %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateZExt
.val build_sext : llvalue -> lltype -> string -> llbuilder -> llvalue
build_sext v ty name b
creates a
%name = sext %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateSExt
.val build_fptoui : llvalue -> lltype -> string -> llbuilder -> llvalue
build_fptoui v ty name b
creates a
%name = fptoui %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFPToUI
.val build_fptosi : llvalue -> lltype -> string -> llbuilder -> llvalue
build_fptosi v ty name b
creates a
%name = fptosi %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFPToSI
.val build_uitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
build_uitofp v ty name b
creates a
%name = uitofp %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateUIToFP
.val build_sitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
build_sitofp v ty name b
creates a
%name = sitofp %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateSIToFP
.val build_fptrunc : llvalue -> lltype -> string -> llbuilder -> llvalue
build_fptrunc v ty name b
creates a
%name = fptrunc %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFPTrunc
.val build_fpext : llvalue -> lltype -> string -> llbuilder -> llvalue
build_fpext v ty name b
creates a
%name = fpext %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFPExt
.val build_ptrtoint : llvalue -> lltype -> string -> llbuilder -> llvalue
build_ptrtoint v ty name b
creates a
%name = prtotint %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreatePtrToInt
.val build_inttoptr : llvalue -> lltype -> string -> llbuilder -> llvalue
build_inttoptr v ty name b
creates a
%name = inttoptr %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateIntToPtr
.val build_bitcast : llvalue -> lltype -> string -> llbuilder -> llvalue
build_bitcast v ty name b
creates a
%name = bitcast %p to %ty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateBitcast
.val build_icmp : Icmp.t ->
llvalue -> llvalue -> string -> llbuilder -> llvalue
build_icmp pred x y name b
creates a
%name = icmp %pred %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateICmp
.val build_fcmp : Fcmp.t ->
llvalue -> llvalue -> string -> llbuilder -> llvalue
build_fcmp pred x y name b
creates a
%name = fcmp %pred %x, %y
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateFCmp
.val build_phi : (llvalue * llbasicblock) list ->
string -> llbuilder -> llvalue
build_phi incoming name b
creates a
%name = phi %incoming
instruction at the position specified by the instruction builder b
.
incoming
is a list of (llvalue, llbasicblock)
tuples.
See the method llvm::LLVMBuilder::CreatePHI
.val build_call : llvalue ->
llvalue array -> string -> llbuilder -> llvalue
build_call fn args name b
creates a
%name = call %fn(args...)
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateCall
.val build_select : llvalue ->
llvalue -> llvalue -> string -> llbuilder -> llvalue
build_select cond thenv elsev name b
creates a
%name = select %cond, %thenv, %elsev
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateSelect
.val build_va_arg : llvalue -> lltype -> string -> llbuilder -> llvalue
build_va_arg valist argty name b
creates a
%name = va_arg %valist, %argty
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateVAArg
.val build_extractelement : llvalue -> llvalue -> string -> llbuilder -> llvalue
build_extractelement vec i name b
creates a
%name = extractelement %vec, %i
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateExtractElement
.val build_insertelement : llvalue ->
llvalue -> llvalue -> string -> llbuilder -> llvalue
build_insertelement vec elt i name b
creates a
%name = insertelement %vec, %elt, %i
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateInsertElement
.val build_shufflevector : llvalue ->
llvalue -> llvalue -> string -> llbuilder -> llvalue
build_shufflevector veca vecb mask name b
creates a
%name = shufflevector %veca, %vecb, %mask
instruction at the position specified by the instruction builder b
.
See the method llvm::LLVMBuilder::CreateShuffleVector
.module ModuleProvider:sig
..end
module MemoryBuffer:sig
..end
module PassManager:sig
..end