llvm.org GIT mirror llvm / e5de63c
[OCaml] Formatting git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193965 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 7 years ago
3 changed file(s) with 48 addition(s) and 172 deletion(s). Raw diff Collapse all Expand all
4141 (** [of_natint n w] boxes the native int [i] in a generic value with the
4242 bitwidth [w]. See the field [llvm::GenericValue::IntVal]. *)
4343 val of_nativeint : Llvm.lltype -> nativeint -> t
44
4544
4645 (** [of_int64 n w] boxes the int64 [i] in a generic value with the bitwidth
4746 [w]. See the field [llvm::GenericValue::IntVal]. *)
109108 (** [dispose ee] releases the memory used by the execution engine and must be
110109 invoked to avoid memory leaks. *)
111110 val dispose : t -> unit
112
111
113112 (** [add_module m ee] adds the module [m] to the execution engine [ee]. *)
114113 val add_module : Llvm.llmodule -> t -> unit
115114
118117 [Error msg] if an error occurs. *)
119118 val remove_module : Llvm.llmodule -> t -> Llvm.llmodule
120119
121
122120 (** [find_function n ee] finds the function named [n] defined in any of the
123121 modules owned by the execution engine [ee]. Returns [None] if the function
124122 is not found and [Some f] otherwise. *)
125123 val find_function : string -> t -> Llvm.llvalue option
126
127124
128125 (** [run_function f args ee] synchronously executes the function [f] with the
129126 arguments [args], which must be compatible with the parameter types. *)
130127 val run_function : Llvm.llvalue -> GenericValue.t array -> t ->
131128 GenericValue.t
132129
133
134130 (** [run_static_ctors ee] executes the static constructors of each module in
135131 the execution engine [ee]. *)
136132 val run_static_ctors : t -> unit
146142 val run_function_as_main : Llvm.llvalue -> string array ->
147143 (string * string) array -> t -> int
148144
149
150145 (** [free_machine_code f ee] releases the memory in the execution engine [ee]
151146 used to store the machine code for the function [f]. *)
152147 val free_machine_code : Llvm.llvalue -> t -> unit
153148
154
155149 (** [target_data ee] is the target data owned by the execution engine
156150 [ee]. *)
157151 val target_data : t -> Llvm_target.DataLayout.t
158
159152 end
160153
161154 val initialize_native_target : unit -> bool
162
255255 end
256256
257257 (** The kind of an [llvalue], the result of [classify_value v].
258 * See the various [LLVMIsA*] functions. *)
258 See the various [LLVMIsA*] functions. *)
259259 module ValueKind : sig
260260 type t =
261261 | NullValue
280280 | Instruction of Opcode.t
281281 end
282282
283
283284 (** {6 Iteration} *)
284285
285286 (** [Before b] and [At_end a] specify positions from the start of the ['b] list
339340 [i686-apple-darwin8]. See the method [llvm::Module::getTargetTriple]. *)
340341 val target_triple: llmodule -> string
341342
342
343343 (** [target_triple triple m] changes the target specifier for the module [m] to
344344 the string [triple]. See the method [llvm::Module::setTargetTriple]. *)
345345 val set_target_triple: string -> llmodule -> unit
346
347346
348347 (** [data_layout m] is the data layout specifier for the module [m], something
349348 like [e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-...-a0:0:64-f80:128:128]. See the
350349 method [llvm::Module::getDataLayout]. *)
351350 val data_layout: llmodule -> string
352351
353
354352 (** [set_data_layout s m] changes the data layout specifier for the module [m]
355353 to the string [s]. See the method [llvm::Module::setDataLayout]. *)
356354 val set_data_layout: string -> llmodule -> unit
364362 val set_module_inline_asm : llmodule -> string -> unit
365363
366364 (** [module_context m] returns the context of the specified module.
367 * See the method [llvm::Module::getContext] *)
365 See the method [llvm::Module::getContext] *)
368366 val module_context : llmodule -> llcontext
367
369368
370369 (** {6 Types} *)
371370
374373 val classify_type : lltype -> TypeKind.t
375374
376375 (** [type_is_sized ty] returns whether the type has a size or not.
377 * If it doesn't then it is not safe to call the [DataLayout::] methods on it.
378 * *)
376 If it doesn't then it is not safe to call the [DataLayout::] methods on it.
377 *)
379378 val type_is_sized : lltype -> bool
380379
381380 (** [type_context ty] returns the {!llcontext} corresponding to the type [ty].
384383
385384 (** [string_of_lltype ty] returns a string describing the type [ty]. *)
386385 val string_of_lltype : lltype -> string
386
387387
388388 (** {7 Operations on integer types} *)
389389
452452 See the method [llvm::FunctionType::get]. *)
453453 val var_arg_function_type : lltype -> lltype array -> lltype
454454
455
456455 (** [is_var_arg fty] returns [true] if [fty] is a varargs function type, [false]
457456 otherwise. See the method [llvm::FunctionType::isVarArg]. *)
458457 val is_var_arg : lltype -> bool
473472 [llvm::StructType::get]. *)
474473 val struct_type : llcontext -> lltype array -> lltype
475474
476
477475 (** [packed_struct_type context ys] returns the packed structure type in the
478476 context [context] containing in the types in the array [tys]. See the method
479477 [llvm::StructType::get]. *)
480478 val packed_struct_type : llcontext -> lltype array -> lltype
481479
482480 (** [struct_name ty] returns the name of the named structure type [ty],
483 * or None if the structure type is not named *)
481 or None if the structure type is not named *)
484482 val struct_name : lltype -> string option
485483
486484 (** [named_struct_type context name] returns the named structure type [name]
487 * in the context [context].
488 * See the method [llvm::StructType::get]. *)
485 in the context [context].
486 See the method [llvm::StructType::get]. *)
489487 val named_struct_type : llcontext -> string -> lltype
490488
491489 (** [struct_set_body ty elts ispacked] sets the body of the named struct [ty]
492 * to the [elts] elements.
493 * See the moethd [llvm::StructType::setBody]. *)
490 to the [elts] elements.
491 See the moethd [llvm::StructType::setBody]. *)
494492 val struct_set_body : lltype -> lltype array -> bool -> unit
495493
496494 (** [struct_element_types sty] returns the constituent types of the struct type
497495 [sty]. See the method [llvm::StructType::getElementType]. *)
498496 val struct_element_types : lltype -> lltype array
499497
500
501498 (** [is_packed sty] returns [true] if the structure type [sty] is packed,
502499 [false] otherwise. See the method [llvm::StructType::isPacked]. *)
503500 val is_packed : lltype -> bool
505502 (** [is_opaque sty] returns [true] if the structure type [sty] is opaque.
506503 [false] otherwise. See the method [llvm::StructType::isOpaque]. *)
507504 val is_opaque : lltype -> bool
505
508506
509507 (** {7 Operations on pointer, vector, and array types} *)
510508
522520 See the method [llvm::PointerType::get]. *)
523521 val qualified_pointer_type : lltype -> int -> lltype
524522
525
526523 (** [vector_type ty n] returns the array type containing [n] elements of the
527524 primitive type [ty]. See the method [llvm::ArrayType::get]. *)
528525 val vector_type : lltype -> int -> lltype
555552 val label_type : llcontext -> lltype
556553
557554 (** [type_by_name m name] returns the specified type from the current module
558 * if it exists.
559 * See the method [llvm::Module::getTypeByName] *)
555 if it exists.
556 See the method [llvm::Module::getTypeByName] *)
560557 val type_by_name : llmodule -> string -> lltype option
558
561559
562560 (* {6 Values} *)
563561
582580 val dump_value : llvalue -> unit
583581
584582 (** [replace_all_uses_with old new] replaces all uses of the value [old]
585 * with the value [new]. See the method [llvm::Value::replaceAllUsesWith]. *)
583 with the value [new]. See the method [llvm::Value::replaceAllUsesWith]. *)
586584 val replace_all_uses_with : llvalue -> llvalue -> unit
587
588585
589586
590587 (* {6 Uses} *)
634631 See the method [llvm::User::getNumOperands]. *)
635632 val num_operands : llvalue -> int
636633
634
637635 (** {7 Operations on constants of (mostly) any type} *)
638636
639637 (** [is_constant v] returns [true] if the value [v] is a constant, [false]
665663 val is_undef : llvalue -> bool
666664
667665 val constexpr_opcode : llvalue -> Opcode.t
666
667
668668 (** {7 Operations on instructions} *)
669669
670670 (** [has_metadata i] returns whether or not the instruction [i] has any
698698 val mdnode : llcontext -> llvalue array -> llvalue
699699
700700 (** [get_mdstring v] returns the MDString.
701 * See the method [llvm::MDString::getString] *)
701 See the method [llvm::MDString::getString] *)
702702 val get_mdstring : llvalue -> string option
703703
704704 (** [get_named_metadata m name] return all the MDNodes belonging to the named
705 * metadata (if any).
706 * See the method [llvm::NamedMDNode::getOperand]. *)
705 metadata (if any).
706 See the method [llvm::NamedMDNode::getOperand]. *)
707707 val get_named_metadata : llmodule -> string -> llvalue array
708
708709
709710 (** {7 Operations on scalar constants} *)
710711
717718 val const_of_int64 : lltype -> Int64.t -> bool -> llvalue
718719
719720 (** [int64_of_const c] returns the int64 value of the [c] constant integer.
720 * None is returned if this is not an integer constant, or bitwidth exceeds 64.
721 * See the method [llvm::ConstantInt::getSExtValue].*)
721 None is returned if this is not an integer constant, or bitwidth exceeds 64.
722 See the method [llvm::ConstantInt::getSExtValue].*)
722723 val int64_of_const : llvalue -> Int64.t option
723724
724725 (** [const_int_of_string ty s r] returns the integer constant of type [ty] and
725 * value [s], with the radix [r]. See the method [llvm::ConstantInt::get]. *)
726 value [s], with the radix [r]. See the method [llvm::ConstantInt::get]. *)
726727 val const_int_of_string : lltype -> string -> int -> llvalue
727
728728
729729 (** [const_float ty n] returns the floating point constant of type [ty] and
730730 value [n]. See the method [llvm::ConstantFP::get]. *)
733733 (** [const_float_of_string ty s] returns the floating point constant of type
734734 [ty] and value [n]. See the method [llvm::ConstantFP::get]. *)
735735 val const_float_of_string : lltype -> string -> llvalue
736
737736
738737
739738 (** {7 Operations on composite constants} *)
776775 [llvm::ConstantStruct::get]. *)
777776 val const_packed_struct : llcontext -> llvalue array -> llvalue
778777
779
780778 (** [const_vector elts] returns the vector constant of type
781779 [vector_type (type_of elts.(0)) (Array.length elts)] and containing the
782780 values [elts]. See the method [llvm::ConstantVector::get]. *)
928926 See the method [llvm::ConstantExpr::getICmp]. *)
929927 val const_icmp : Icmp.t -> llvalue -> llvalue -> llvalue
930928
931
932929 (** [const_fcmp pred c1 c2] returns the constant comparison of two floating
933930 point constants, [c1 pred c2].
934931 See the method [llvm::ConstantExpr::getFCmp]. *)
935932 val const_fcmp : Fcmp.t -> llvalue -> llvalue -> llvalue
936933
937
938934 (** [const_shl c1 c2] returns the constant integer [c1] left-shifted by the
939935 constant integer [c2].
940936 See the method [llvm::ConstantExpr::getShl]. *)
960956 See the method [llvm::ConstantExpr::getInBoundsGetElementPtr]. *)
961957 val const_in_bounds_gep : llvalue -> llvalue array -> llvalue
962958
963
964959 (** [const_trunc c ty] returns the constant truncation of integer constant [c]
965960 to the smaller integer type [ty].
966961 See the method [llvm::ConstantExpr::getTrunc]. *)
10261021 See the method [llvm::ConstantExpr::getZExtOrBitCast]. *)
10271022 val const_zext_or_bitcast : llvalue -> lltype -> llvalue
10281023
1029
10301024 (** [const_sext_or_bitcast c ty] returns a constant sext or bitwise cast
10311025 conversion of constant [c] to type [ty].
10321026 See the method [llvm::ConstantExpr::getSExtOrBitCast]. *)
10331027 val const_sext_or_bitcast : llvalue -> lltype -> llvalue
10341028
1035
10361029 (** [const_trunc_or_bitcast c ty] returns a constant trunc or bitwise cast
10371030 conversion of constant [c] to type [ty].
10381031 See the method [llvm::ConstantExpr::getTruncOrBitCast]. *)
10391032 val const_trunc_or_bitcast : llvalue -> lltype -> llvalue
10401033
1041
10421034 (** [const_pointercast c ty] returns a constant bitcast or a pointer-to-int
10431035 cast conversion of constant [c] to type [ty] of equal size.
10441036 See the method [llvm::ConstantExpr::getPointerCast]. *)
10451037 val const_pointercast : llvalue -> lltype -> llvalue
10461038
1047
10481039 (** [const_intcast c ty] returns a constant zext, bitcast, or trunc for integer
10491040 -> integer casts of constant [c] to type [ty].
10501041 See the method [llvm::ConstantExpr::getIntCast]. *)
10511042 val const_intcast : llvalue -> lltype -> llvalue
10521043
1053
10541044 (** [const_fpcast c ty] returns a constant fpext, bitcast, or fptrunc for fp ->
10551045 fp casts of constant [c] to type [ty].
10561046 See the method [llvm::ConstantExpr::getFPCast]. *)
10571047 val const_fpcast : llvalue -> lltype -> llvalue
10581048
1059
10601049 (** [const_select cond t f] returns the constant conditional which returns value
10611050 [t] if the boolean constant [cond] is true and the value [f] otherwise.
10621051 See the method [llvm::ConstantExpr::getSelect]. *)
10631052 val const_select : llvalue -> llvalue -> llvalue -> llvalue
1064
10651053
10661054 (** [const_extractelement vec i] returns the constant [i]th element of
10671055 constant vector [vec]. [i] must be a constant [i32] value unsigned less than
10681056 the size of the vector.
10691057 See the method [llvm::ConstantExpr::getExtractElement]. *)
10701058 val const_extractelement : llvalue -> llvalue -> llvalue
1071
10721059
10731060 (** [const_insertelement vec v i] returns the constant vector with the same
10741061 elements as constant vector [v] but the [i]th element replaced by the
10781065 See the method [llvm::ConstantExpr::getInsertElement]. *)
10791066 val const_insertelement : llvalue -> llvalue -> llvalue -> llvalue
10801067
1081
10821068 (** [const_shufflevector a b mask] returns a constant [shufflevector].
10831069 See the LLVM Language Reference for details on the [shufflevector]
10841070 instruction.
10851071 See the method [llvm::ConstantExpr::getShuffleVector]. *)
10861072 val const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue
10871073
1088
10891074 (** [const_extractvalue agg idxs] returns the constant [idxs]th value of
10901075 constant aggregate [agg]. Each [idxs] must be less than the size of the
10911076 aggregate. See the method [llvm::ConstantExpr::getExtractValue]. *)
10921077 val const_extractvalue : llvalue -> int array -> llvalue
10931078
1094
10951079 (** [const_insertvalue agg val idxs] inserts the value [val] in the specified
10961080 indexs [idxs] in the aggegate [agg]. Each [idxs] must be less than the size
10971081 of the aggregate. See the method [llvm::ConstantExpr::getInsertValue]. *)
10981082 val const_insertvalue : llvalue -> llvalue -> int array -> llvalue
10991083
1100
11011084 (** [const_inline_asm ty asm con side align] inserts a inline assembly string.
11021085 See the method [llvm::InlineAsm::get]. *)
1103 val const_inline_asm : lltype -> string -> string -> bool -> bool ->
1104 llvalue
1105
1086 val const_inline_asm : lltype -> string -> string -> bool -> bool -> llvalue
11061087
11071088 (** [block_address f bb] returns the address of the basic block [bb] in the
11081089 function [f]. See the method [llvm::BasicBlock::get]. *)
11431124 (** [set_visibility v g] sets the linker visibility of the global value [g] to
11441125 [v]. See the method [llvm::GlobalValue::setVisibility]. *)
11451126 val set_visibility : Visibility.t -> llvalue -> unit
1146
11471127
11481128 (** [alignment g] returns the required alignment of the global value [g].
11491129 See the method [llvm::GlobalValue::getAlignment]. *)
11621142 global differs, then a bitcast to [ty] is returned. *)
11631143 val declare_global : lltype -> string -> llmodule -> llvalue
11641144
1165
11661145 (** [declare_qualified_global ty name addrspace m] returns a new global variable
11671146 of type [ty] and with name [name] in module [m] in the address space
11681147 [addrspace]. If such a global variable already exists, it is returned. If
11691148 the type of the existing global differs, then a bitcast to [ty] is
11701149 returned. *)
1171 val declare_qualified_global : lltype -> string -> int -> llmodule ->
1172 llvalue
1173
1150 val declare_qualified_global : lltype -> string -> int -> llmodule -> llvalue
11741151
11751152 (** [define_global name init m] returns a new global with name [name] and
11761153 initializer [init] in module [m] in the default address space (0). If the
11781155 See the constructor of [llvm::GlobalVariable]. *)
11791156 val define_global : string -> llvalue -> llmodule -> llvalue
11801157
1181
11821158 (** [define_qualified_global name init addrspace m] returns a new global with
11831159 name [name] and initializer [init] in module [m] in the address space
11841160 [addrspace]. If the named global already exists, it is renamed.
11851161 See the constructor of [llvm::GlobalVariable]. *)
1186 val define_qualified_global : string -> llvalue -> int -> llmodule ->
1187 llvalue
1188
1162 val define_qualified_global : string -> llvalue -> int -> llmodule -> llvalue
11891163
11901164 (** [lookup_global name m] returns [Some g] if a global variable with name
11911165 [name] exists in module [m]. If no such global exists, returns [None].
11921166 See the [llvm::GlobalVariable] constructor. *)
11931167 val lookup_global : string -> llmodule -> llvalue option
1194
11951168
11961169 (** [delete_global gv] destroys the global variable [gv].
11971170 See the method [llvm::GlobalVariable::eraseFromParent]. *)
12031176 See the method [llvm::Module::global_begin]. *)
12041177 val global_begin : llmodule -> (llmodule, llvalue) llpos
12051178
1206
12071179 (** [global_succ gv] returns the global variable list position succeeding
12081180 [Before gv].
12091181 See the method [llvm::Module::global_iterator::operator++]. *)
12101182 val global_succ : llvalue -> (llmodule, llvalue) llpos
1211
12121183
12131184 (** [iter_globals f m] applies function [f] to each of the global variables of
12141185 module [m] in order. Tail recursive. *)
12241195 See the method [llvm::Module::global_end]. *)
12251196 val global_end : llmodule -> (llmodule, llvalue) llrev_pos
12261197
1227
12281198 (** [global_pred gv] returns the global variable list position preceding
12291199 [After gv].
12301200 See the method [llvm::Module::global_iterator::operator--]. *)
12311201 val global_pred : llvalue -> (llmodule, llvalue) llrev_pos
12321202
1233
12341203 (** [rev_iter_globals f m] applies function [f] to each of the global variables
12351204 of module [m] in reverse order. Tail recursive. *)
12361205 val rev_iter_globals : (llvalue -> unit) -> llmodule -> unit
12491218 See the method [llvm::GlobalVariable::setConstant]. *)
12501219 val set_global_constant : bool -> llvalue -> unit
12511220
1252
12531221 (** [global_initializer gv] returns the initializer for the global variable
12541222 [gv]. See the method [llvm::GlobalVariable::getInitializer]. *)
12551223 val global_initializer : llvalue -> llvalue
12811249 the aliasee [a] with the name [n].
12821250 See the constructor for [llvm::GlobalAlias]. *)
12831251 val add_alias : llmodule -> lltype -> llvalue -> string -> llvalue
1284
12851252
12861253
12871254 (** {7 Operations on functions} *)
12921259 to [ty] is returned. *)
12931260 val declare_function : string -> lltype -> llmodule -> llvalue
12941261
1295
12961262 (** [define_function name ty m] creates a new function with name [name] and
12971263 type [ty] in module [m]. If the named function already exists, it is
12981264 renamed. An entry basic block is created in the function.
12991265 See the constructor of [llvm::GlobalVariable]. *)
13001266 val define_function : string -> lltype -> llmodule -> llvalue
13011267
1302
13031268 (** [lookup_function name m] returns [Some f] if a function with name
13041269 [name] exists in module [m]. If no such function exists, returns [None].
13051270 See the method [llvm::Module] constructor. *)
13061271 val lookup_function : string -> llmodule -> llvalue option
1307
13081272
13091273 (** [delete_function f] destroys the function [f].
13101274 See the method [llvm::Function::eraseFromParent]. *)
13161280 See the method [llvm::Module::begin]. *)
13171281 val function_begin : llmodule -> (llmodule, llvalue) llpos
13181282
1319
13201283 (** [function_succ gv] returns the function list position succeeding
13211284 [Before gv].
13221285 See the method [llvm::Module::iterator::operator++]. *)
13231286 val function_succ : llvalue -> (llmodule, llvalue) llpos
1324
13251287
13261288 (** [iter_functions f m] applies function [f] to each of the functions of module
13271289 [m] in order. Tail recursive. *)
13371299 See the method [llvm::Module::end]. *)
13381300 val function_end : llmodule -> (llmodule, llvalue) llrev_pos
13391301
1340
13411302 (** [function_pred gv] returns the function list position preceding [After gv].
13421303 See the method [llvm::Module::iterator::operator--]. *)
13431304 val function_pred : llvalue -> (llmodule, llvalue) llrev_pos
1344
13451305
13461306 (** [rev_iter_functions f fn] applies function [f] to each of the functions of
13471307 module [m] in reverse order. Tail recursive. *)
13641324 See the method [llvm::Function::setCallingConv]. *)
13651325 val set_function_call_conv : int -> llvalue -> unit
13661326
1367
13681327 (** [gc f] returns [Some name] if the function [f] has a garbage
13691328 collection algorithm specified and [None] otherwise.
13701329 See the method [llvm::Function::getGC]. *)
13791338 val add_function_attr : llvalue -> Attribute.t -> unit
13801339
13811340 (** [function_attr f] returns the function attribute for the function [f].
1382 * See the method [llvm::Function::getAttributes] *)
1341 See the method [llvm::Function::getAttributes] *)
13831342 val function_attr : llvalue -> Attribute.t list
13841343
13851344 (** [remove_function_attr f a] removes attribute [a] from the return type of
13861345 function [f]. *)
13871346 val remove_function_attr : llvalue -> Attribute.t -> unit
13881347
1348
13891349 (** {7 Operations on params} *)
13901350
13911351 (** [params f] returns the parameters of function [f].
13971357 val param : llvalue -> int -> llvalue
13981358
13991359 (** [param_attr p] returns the attributes of parameter [p].
1400 * See the methods [llvm::Function::getAttributes] and
1401 * [llvm::Attributes::getParamAttributes] *)
1360 See the methods [llvm::Function::getAttributes] and
1361 [llvm::Attributes::getParamAttributes] *)
14021362 val param_attr : llvalue -> Attribute.t list
14031363
14041364 (** [param_parent p] returns the parent function that owns the parameter.
14341394 See the method [llvm::Function::arg_iterator::operator--]. *)
14351395 val param_pred : llvalue -> (llvalue, llvalue) llrev_pos
14361396
1437
14381397 (** [rev_iter_params f fn] applies function [f] to each of the parameters
14391398 of function [fn] in reverse order. Tail recursive. *)
14401399 val rev_iter_params : (llvalue -> unit) -> llvalue -> unit
14721431 See the constructor of [llvm::BasicBlock]. *)
14731432 val append_block : llcontext -> string -> llvalue -> llbasicblock
14741433
1475
14761434 (** [insert_block c name bb] creates a new basic block named [name] before the
14771435 basic block [bb] in the context [c].
14781436 See the constructor of [llvm::BasicBlock]. *)
14791437 val insert_block : llcontext -> string -> llbasicblock -> llbasicblock
1480
14811438
14821439 (** [block_parent bb] returns the parent function that owns the basic block.
14831440 See the method [llvm::BasicBlock::getParent]. *)
14891446 See the method [llvm::Function::begin]. *)
14901447 val block_begin : llvalue -> (llvalue, llbasicblock) llpos
14911448
1492
14931449 (** [block_succ bb] returns the basic block list position succeeding
14941450 [Before bb].
14951451 See the method [llvm::Function::iterator::operator++]. *)
14961452 val block_succ : llbasicblock -> (llvalue, llbasicblock) llpos
1497
14981453
14991454 (** [iter_blocks f fn] applies function [f] to each of the basic blocks
15001455 of function [fn] in order. Tail recursive. *)
15101465 See the method [llvm::Function::end]. *)
15111466 val block_end : llvalue -> (llvalue, llbasicblock) llrev_pos
15121467
1513
15141468 (** [block_pred gv] returns the function list position preceding [After gv].
15151469 See the method [llvm::Function::iterator::operator--]. *)
15161470 val block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos
15491503 See the method [llvm::BasicBlock::begin]. *)
15501504 val instr_begin : llbasicblock -> (llbasicblock, llvalue) llpos
15511505
1552
15531506 (** [instr_succ i] returns the instruction list position succeeding [Before i].
15541507 See the method [llvm::BasicBlock::iterator::operator++]. *)
15551508 val instr_succ : llvalue -> (llbasicblock, llvalue) llpos
1556
15571509
15581510 (** [iter_instrs f bb] applies function [f] to each of the instructions of basic
15591511 block [bb] in order. Tail recursive. *)
15691521 See the method [llvm::BasicBlock::end]. *)
15701522 val instr_end : llbasicblock -> (llbasicblock, llvalue) llrev_pos
15711523
1572
15731524 (** [instr_pred i] returns the instruction list position preceding [After i].
15741525 See the method [llvm::BasicBlock::iterator::operator--]. *)
15751526 val instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos
15761527
1577
15781528 (** [fold_right_instrs f bb init] is [f (... (f init fN) ...) f1] where
15791529 [f1,...,fN] are the instructions of basic block [bb]. Tail recursive. *)
15801530 val fold_right_instrs: (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a
15821532 val instr_opcode : llvalue -> Opcode.t
15831533
15841534 val icmp_predicate : llvalue -> Icmp.t option
1535
15851536
15861537 (** {7 Operations on call sites} *)
15871538
15901541 {!CallConv}. See the method [llvm::CallInst::getCallingConv] and
15911542 [llvm::InvokeInst::getCallingConv]. *)
15921543 val instruction_call_conv: llvalue -> int
1593
15941544
15951545 (** [set_instruction_call_conv cc ci] sets the calling convention for the call
15961546 or invoke instruction [ci] to the integer [cc], which can be one of the
15991549 and [llvm::InvokeInst::setCallingConv]. *)
16001550 val set_instruction_call_conv: int -> llvalue -> unit
16011551
1602
16031552 (** [add_instruction_param_attr ci i a] adds attribute [a] to the [i]th
16041553 parameter of the call or invoke instruction [ci]. [i]=0 denotes the return
16051554 value. *)
16101559 return value. *)
16111560 val remove_instruction_param_attr : llvalue -> int -> Attribute.t -> unit
16121561
1562
16131563 (** {Operations on call instructions (only)} *)
16141564
16151565 (** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as
16221572 See the method [llvm::CallInst::setTailCall]. *)
16231573 val set_tail_call : bool -> llvalue -> unit
16241574
1575
16251576 (** {7 Operations on phi nodes} *)
16261577
16271578 (** [add_incoming (v, bb) pn] adds the value [v] to the phi node [pn] for use
16281579 with branches from [bb]. See the method [llvm::PHINode::addIncoming]. *)
16291580 val add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
16301581
1631
16321582 (** [incoming pn] returns the list of value-block pairs for phi node [pn].
16331583 See the method [llvm::PHINode::getIncomingValue]. *)
16341584 val incoming : llvalue -> (llvalue * llbasicblock) list
16361586 (** [delete_instruction i] deletes the instruction [i].
16371587 * See the method [llvm::Instruction::eraseFromParent]. *)
16381588 val delete_instruction : llvalue -> unit
1589
16391590
16401591 (** {6 Instruction builders} *)
16411592
16621613 See the constructor for [llvm::LLVMBuilder]. *)
16631614 val position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit
16641615
1665
16661616 (** [position_before ins b] moves the instruction builder [b] to before the
16671617 instruction [isn]. See the method [llvm::LLVMBuilder::SetInsertPoint]. *)
16681618 val position_before : llvalue -> llbuilder -> unit
16901640 See the method [llvm::IRBuilder::SetDebugLocation]. *)
16911641 val set_current_debug_location : llbuilder -> llvalue -> unit
16921642
1693
16941643 (** [clear_current_debug_location b] clears the current debug location in the
16951644 builder [b]. *)
16961645 val clear_current_debug_location : llbuilder -> unit
1697
16981646
16991647 (** [current_debug_location b] returns the current debug location, or None
17001648 if none is currently set.
17011649 See the method [llvm::IRBuilder::GetDebugLocation]. *)
17021650 val current_debug_location : llbuilder -> llvalue option
17031651
1704
17051652 (** [set_inst_debug_location b i] sets the current debug location of the builder
17061653 [b] to the instruction [i].
17071654 See the method [llvm::IRBuilder::SetInstDebugLocation]. *)
17271674 instruction at the position specified by the instruction builder [b].
17281675 See the method [llvm::LLVMBuilder::CreateAggregateRet]. *)
17291676 val build_aggregate_ret : llvalue array -> llbuilder -> llvalue
1730
17311677
17321678 (** [build_br bb b] creates a
17331679 [br %bb]
17701716 val add_case : llvalue -> llvalue -> llbasicblock -> unit
17711717
17721718 (** [switch_default_dest sw] returns the default destination of the [switch]
1773 * instruction.
1774 * See the method [llvm:;SwitchInst::getDefaultDest]. **)
1719 instruction.
1720 See the method [llvm:;SwitchInst::getDefaultDest]. **)
17751721 val switch_default_dest : llvalue -> llbasicblock
17761722
17771723 (** [build_indirect_br addr count b] creates a
17811727 See the method [llvm::LLVMBuilder::CreateIndirectBr]. *)
17821728 val build_indirect_br : llvalue -> int -> llbuilder -> llvalue
17831729
1784
17851730 (** [add_destination br bb] adds the basic block [bb] as a possible branch
17861731 location for the indirectbr instruction [br].
17871732 See the method [llvm::IndirectBrInst::addDestination]. **)
17881733 val add_destination : llvalue -> llbasicblock -> unit
17891734
1790
17911735 (** [build_invoke fn args tobb unwindbb name b] creates an
17921736 [%name = invoke %fn(args) to %tobb unwind %unwindbb]
17931737 instruction at the position specified by the instruction builder [b].
18101754 See the method [llvm::LandingPadInst::addClause]. *)
18111755 val add_clause : llvalue -> llvalue -> unit
18121756
1813 (* [build_resume exn b] builds a [resume exn] instruction
1814 * at the position specified by the instruction builder [b].
1815 * See the method [llvm::LLVMBuilder::CreateResume] *)
1757 (** [build_resume exn b] builds a [resume exn] instruction
1758 at the position specified by the instruction builder [b].
1759 See the method [llvm::LLVMBuilder::CreateResume] *)
18161760 val build_resume : llvalue -> llbuilder -> llvalue
18171761
18181762 (** [build_unreachable b] creates an
18301774 See the method [llvm::LLVMBuilder::CreateAdd]. *)
18311775 val build_add : llvalue -> llvalue -> string -> llbuilder -> llvalue
18321776
1833
18341777 (** [build_nsw_add x y name b] creates a
18351778 [%name = nsw add %x, %y]
18361779 instruction at the position specified by the instruction builder [b].
18371780 See the method [llvm::LLVMBuilder::CreateNSWAdd]. *)
18381781 val build_nsw_add : llvalue -> llvalue -> string -> llbuilder -> llvalue
18391782
1840
18411783 (** [build_nuw_add x y name b] creates a
18421784 [%name = nuw add %x, %y]
18431785 instruction at the position specified by the instruction builder [b].
18441786 See the method [llvm::LLVMBuilder::CreateNUWAdd]. *)
18451787 val build_nuw_add : llvalue -> llvalue -> string -> llbuilder -> llvalue
18461788
1847
18481789 (** [build_fadd x y name b] creates a
18491790 [%name = fadd %x, %y]
18501791 instruction at the position specified by the instruction builder [b].
18511792 See the method [llvm::LLVMBuilder::CreateFAdd]. *)
18521793 val build_fadd : llvalue -> llvalue -> string -> llbuilder -> llvalue
18531794
1854
18551795 (** [build_sub x y name b] creates a
18561796 [%name = sub %x, %y]
18571797 instruction at the position specified by the instruction builder [b].
18581798 See the method [llvm::LLVMBuilder::CreateSub]. *)
18591799 val build_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue
18601800
1861
18621801 (** [build_nsw_sub x y name b] creates a
18631802 [%name = nsw sub %x, %y]
18641803 instruction at the position specified by the instruction builder [b].
18651804 See the method [llvm::LLVMBuilder::CreateNSWSub]. *)
18661805 val build_nsw_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue
18671806
1868
18691807 (** [build_nuw_sub x y name b] creates a
18701808 [%name = nuw sub %x, %y]
18711809 instruction at the position specified by the instruction builder [b].
18721810 See the method [llvm::LLVMBuilder::CreateNUWSub]. *)
18731811 val build_nuw_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue
18741812
1875
18761813 (** [build_fsub x y name b] creates a
18771814 [%name = fsub %x, %y]
18781815 instruction at the position specified by the instruction builder [b].
18791816 See the method [llvm::LLVMBuilder::CreateFSub]. *)
18801817 val build_fsub : llvalue -> llvalue -> string -> llbuilder -> llvalue
18811818
1882
18831819 (** [build_mul x y name b] creates a
18841820 [%name = mul %x, %y]
18851821 instruction at the position specified by the instruction builder [b].
18861822 See the method [llvm::LLVMBuilder::CreateMul]. *)
18871823 val build_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue
18881824
1889
18901825 (** [build_nsw_mul x y name b] creates a
18911826 [%name = nsw mul %x, %y]
18921827 instruction at the position specified by the instruction builder [b].
18931828 See the method [llvm::LLVMBuilder::CreateNSWMul]. *)
18941829 val build_nsw_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue
18951830
1896
18971831 (** [build_nuw_mul x y name b] creates a
18981832 [%name = nuw mul %x, %y]
18991833 instruction at the position specified by the instruction builder [b].
19001834 See the method [llvm::LLVMBuilder::CreateNUWMul]. *)
19011835 val build_nuw_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue
19021836
1903
19041837 (** [build_fmul x y name b] creates a
19051838 [%name = fmul %x, %y]
19061839 instruction at the position specified by the instruction builder [b].
19071840 See the method [llvm::LLVMBuilder::CreateFMul]. *)
19081841 val build_fmul : llvalue -> llvalue -> string -> llbuilder -> llvalue
19091842
1910
19111843 (** [build_udiv x y name b] creates a
19121844 [%name = udiv %x, %y]
19131845 instruction at the position specified by the instruction builder [b].
19141846 See the method [llvm::LLVMBuilder::CreateUDiv]. *)
19151847 val build_udiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
19161848
1917
19181849 (** [build_sdiv x y name b] creates a
19191850 [%name = sdiv %x, %y]
19201851 instruction at the position specified by the instruction builder [b].
19211852 See the method [llvm::LLVMBuilder::CreateSDiv]. *)
19221853 val build_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
19231854
1924
19251855 (** [build_exact_sdiv x y name b] creates a
19261856 [%name = exact sdiv %x, %y]
19271857 instruction at the position specified by the instruction builder [b].
19281858 See the method [llvm::LLVMBuilder::CreateExactSDiv]. *)
19291859 val build_exact_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
19301860
1931
19321861 (** [build_fdiv x y name b] creates a
19331862 [%name = fdiv %x, %y]
19341863 instruction at the position specified by the instruction builder [b].
19351864 See the method [llvm::LLVMBuilder::CreateFDiv]. *)
19361865 val build_fdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue
19371866
1938
19391867 (** [build_urem x y name b] creates a
19401868 [%name = urem %x, %y]
19411869 instruction at the position specified by the instruction builder [b].
19421870 See the method [llvm::LLVMBuilder::CreateURem]. *)
19431871 val build_urem : llvalue -> llvalue -> string -> llbuilder -> llvalue
19441872
1945
19461873 (** [build_SRem x y name b] creates a
19471874 [%name = srem %x, %y]
19481875 instruction at the position specified by the instruction builder [b].
19491876 See the method [llvm::LLVMBuilder::CreateSRem]. *)
19501877 val build_srem : llvalue -> llvalue -> string -> llbuilder -> llvalue
19511878
1952
19531879 (** [build_frem x y name b] creates a
19541880 [%name = frem %x, %y]
19551881 instruction at the position specified by the instruction builder [b].
19561882 See the method [llvm::LLVMBuilder::CreateFRem]. *)
19571883 val build_frem : llvalue -> llvalue -> string -> llbuilder -> llvalue
19581884
1959
19601885 (** [build_shl x y name b] creates a
19611886 [%name = shl %x, %y]
19621887 instruction at the position specified by the instruction builder [b].
19631888 See the method [llvm::LLVMBuilder::CreateShl]. *)
19641889 val build_shl : llvalue -> llvalue -> string -> llbuilder -> llvalue
19651890
1966
19671891 (** [build_lshr x y name b] creates a
19681892 [%name = lshr %x, %y]
19691893 instruction at the position specified by the instruction builder [b].
19701894 See the method [llvm::LLVMBuilder::CreateLShr]. *)
19711895 val build_lshr : llvalue -> llvalue -> string -> llbuilder -> llvalue
19721896
1973
19741897 (** [build_ashr x y name b] creates a
19751898 [%name = ashr %x, %y]
19761899 instruction at the position specified by the instruction builder [b].
19771900 See the method [llvm::LLVMBuilder::CreateAShr]. *)
19781901 val build_ashr : llvalue -> llvalue -> string -> llbuilder -> llvalue
19791902
1980
19811903 (** [build_and x y name b] creates a
19821904 [%name = and %x, %y]
19831905 instruction at the position specified by the instruction builder [b].
19841906 See the method [llvm::LLVMBuilder::CreateAnd]. *)
19851907 val build_and : llvalue -> llvalue -> string -> llbuilder -> llvalue
19861908
1987
19881909 (** [build_or x y name b] creates a
19891910 [%name = or %x, %y]
19901911 instruction at the position specified by the instruction builder [b].
19911912 See the method [llvm::LLVMBuilder::CreateOr]. *)
19921913 val build_or : llvalue -> llvalue -> string -> llbuilder -> llvalue
19931914
1994
19951915 (** [build_xor x y name b] creates a
19961916 [%name = xor %x, %y]
19971917 instruction at the position specified by the instruction builder [b].
19981918 See the method [llvm::LLVMBuilder::CreateXor]. *)
19991919 val build_xor : llvalue -> llvalue -> string -> llbuilder -> llvalue
2000
20011920
20021921 (** [build_neg x name b] creates a
20031922 [%name = sub 0, %x]
20061925 See the method [llvm::LLVMBuilder::CreateNeg]. *)
20071926 val build_neg : llvalue -> string -> llbuilder -> llvalue
20081927
2009
20101928 (** [build_nsw_neg x name b] creates a
20111929 [%name = nsw sub 0, %x]
20121930 instruction at the position specified by the instruction builder [b].
20141932 See the method [llvm::LLVMBuilder::CreateNeg]. *)
20151933 val build_nsw_neg : llvalue -> string -> llbuilder -> llvalue
20161934
2017
20181935 (** [build_nuw_neg x name b] creates a
20191936 [%name = nuw sub 0, %x]
20201937 instruction at the position specified by the instruction builder [b].
20221939 See the method [llvm::LLVMBuilder::CreateNeg]. *)
20231940 val build_nuw_neg : llvalue -> string -> llbuilder -> llvalue
20241941
2025
20261942 (** [build_fneg x name b] creates a
20271943 [%name = fsub 0, %x]
20281944 instruction at the position specified by the instruction builder [b].
20301946 See the method [llvm::LLVMBuilder::CreateFNeg]. *)
20311947 val build_fneg : llvalue -> string -> llbuilder -> llvalue
20321948
2033
20341949 (** [build_xor x name b] creates a
20351950 [%name = xor %x, -1]
20361951 instruction at the position specified by the instruction builder [b].
20391954 val build_not : llvalue -> string -> llbuilder -> llvalue
20401955
20411956
2042
20431957 (** {7 Memory} *)
20441958
20451959 (** [build_alloca ty name b] creates a
20471961 instruction at the position specified by the instruction builder [b].
20481962 See the method [llvm::LLVMBuilder::CreateAlloca]. *)
20491963 val build_alloca : lltype -> string -> llbuilder -> llvalue
2050
20511964
20521965 (** [build_array_alloca ty n name b] creates a
20531966 [%name = alloca %ty, %n]
20621975 See the method [llvm::LLVMBuilder::CreateLoad]. *)
20631976 val build_load : llvalue -> string -> llbuilder -> llvalue
20641977
2065
20661978 (** [build_store v p b] creates a
20671979 [store %v, %p]
20681980 instruction at the position specified by the instruction builder [b].
20691981 See the method [llvm::LLVMBuilder::CreateStore]. *)
20701982 val build_store : llvalue -> llvalue -> llbuilder -> llvalue
20711983
2072
20731984 (** [build_gep p indices name b] creates a
20741985 [%name = getelementptr %p, indices...]
20751986 instruction at the position specified by the instruction builder [b].
20761987 See the method [llvm::LLVMBuilder::CreateGetElementPtr]. *)
20771988 val build_gep : llvalue -> llvalue array -> string -> llbuilder -> llvalue
2078
20791989
20801990 (** [build_in_bounds_gep p indices name b] creates a
20811991 [%name = gelementptr inbounds %p, indices...]
20952005 a global string at the position specified by the instruction builder [b].
20962006 See the method [llvm::LLVMBuilder::CreateGlobalString]. *)
20972007 val build_global_string : string -> string -> llbuilder -> llvalue
2098
20992008
21002009 (** [build_global_stringptr str name b] creates a series of instructions that
21012010 adds a global string pointer at the position specified by the instruction
21042013 val build_global_stringptr : string -> string -> llbuilder -> llvalue
21052014
21062015
2107
21082016 (** {7 Casts} *)
21092017
21102018 (** [build_trunc v ty name b] creates a
21132021 See the method [llvm::LLVMBuilder::CreateTrunc]. *)
21142022 val build_trunc : llvalue -> lltype -> string -> llbuilder -> llvalue
21152023
2116
21172024 (** [build_zext v ty name b] creates a
21182025 [%name = zext %p to %ty]
21192026 instruction at the position specified by the instruction builder [b].
21202027 See the method [llvm::LLVMBuilder::CreateZExt]. *)
21212028 val build_zext : llvalue -> lltype -> string -> llbuilder -> llvalue
21222029
2123
21242030 (** [build_sext v ty name b] creates a
21252031 [%name = sext %p to %ty]
21262032 instruction at the position specified by the instruction builder [b].
21272033 See the method [llvm::LLVMBuilder::CreateSExt]. *)
21282034 val build_sext : llvalue -> lltype -> string -> llbuilder -> llvalue
21292035
2130
21312036 (** [build_fptoui v ty name b] creates a
21322037 [%name = fptoui %p to %ty]
21332038 instruction at the position specified by the instruction builder [b].
21342039 See the method [llvm::LLVMBuilder::CreateFPToUI]. *)
21352040 val build_fptoui : llvalue -> lltype -> string -> llbuilder -> llvalue
21362041
2137
21382042 (** [build_fptosi v ty name b] creates a
21392043 [%name = fptosi %p to %ty]
21402044 instruction at the position specified by the instruction builder [b].
21412045 See the method [llvm::LLVMBuilder::CreateFPToSI]. *)
21422046 val build_fptosi : llvalue -> lltype -> string -> llbuilder -> llvalue
21432047
2144
21452048 (** [build_uitofp v ty name b] creates a
21462049 [%name = uitofp %p to %ty]
21472050 instruction at the position specified by the instruction builder [b].
21482051 See the method [llvm::LLVMBuilder::CreateUIToFP]. *)
21492052 val build_uitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
21502053
2151
21522054 (** [build_sitofp v ty name b] creates a
21532055 [%name = sitofp %p to %ty]
21542056 instruction at the position specified by the instruction builder [b].
21552057 See the method [llvm::LLVMBuilder::CreateSIToFP]. *)
21562058 val build_sitofp : llvalue -> lltype -> string -> llbuilder -> llvalue
21572059
2158
21592060 (** [build_fptrunc v ty name b] creates a
21602061 [%name = fptrunc %p to %ty]
21612062 instruction at the position specified by the instruction builder [b].
21622063 See the method [llvm::LLVMBuilder::CreateFPTrunc]. *)
21632064 val build_fptrunc : llvalue -> lltype -> string -> llbuilder -> llvalue
21642065
2165
21662066 (** [build_fpext v ty name b] creates a
21672067 [%name = fpext %p to %ty]
21682068 instruction at the position specified by the instruction builder [b].
21692069 See the method [llvm::LLVMBuilder::CreateFPExt]. *)
21702070 val build_fpext : llvalue -> lltype -> string -> llbuilder -> llvalue
21712071
2172
21732072 (** [build_ptrtoint v ty name b] creates a
21742073 [%name = prtotint %p to %ty]
21752074 instruction at the position specified by the instruction builder [b].
21762075 See the method [llvm::LLVMBuilder::CreatePtrToInt]. *)
21772076 val build_ptrtoint : llvalue -> lltype -> string -> llbuilder -> llvalue
21782077
2179
21802078 (** [build_inttoptr v ty name b] creates a
21812079 [%name = inttoptr %p to %ty]
21822080 instruction at the position specified by the instruction builder [b].
21832081 See the method [llvm::LLVMBuilder::CreateIntToPtr]. *)
21842082 val build_inttoptr : llvalue -> lltype -> string -> llbuilder -> llvalue
21852083
2186
21872084 (** [build_bitcast v ty name b] creates a
21882085 [%name = bitcast %p to %ty]
21892086 instruction at the position specified by the instruction builder [b].
21902087 See the method [llvm::LLVMBuilder::CreateBitCast]. *)
21912088 val build_bitcast : llvalue -> lltype -> string -> llbuilder -> llvalue
2192
21932089
21942090 (** [build_zext_or_bitcast v ty name b] creates a zext or bitcast
21952091 instruction at the position specified by the instruction builder [b].
22142110 See the method [llvm::LLVMBuilder::CreatePointerCast]. *)
22152111 val build_pointercast : llvalue -> lltype -> string -> llbuilder -> llvalue
22162112
2217
22182113 (** [build_intcast v ty name b] creates a zext, bitcast, or trunc
22192114 instruction at the position specified by the instruction builder [b].
22202115 See the method [llvm::LLVMBuilder::CreateIntCast]. *)
22212116 val build_intcast : llvalue -> lltype -> string -> llbuilder -> llvalue
22222117
2223
22242118 (** [build_fpcast v ty name b] creates a fpext, bitcast, or fptrunc
22252119 instruction at the position specified by the instruction builder [b].
22262120 See the method [llvm::LLVMBuilder::CreateFPCast]. *)
22272121 val build_fpcast : llvalue -> lltype -> string -> llbuilder -> llvalue
2228
22292122
22302123
22312124 (** {7 Comparisons} *)
22612154 See the method [llvm::LLVMBuilder::CreateCall]. *)
22622155 val build_call : llvalue -> llvalue array -> string -> llbuilder -> llvalue
22632156
2264
22652157 (** [build_select cond thenv elsev name b] creates a
22662158 [%name = select %cond, %thenv, %elsev]
22672159 instruction at the position specified by the instruction builder [b].
22752167 See the method [llvm::LLVMBuilder::CreateVAArg]. *)
22762168 val build_va_arg : llvalue -> lltype -> string -> llbuilder -> llvalue
22772169
2278
22792170 (** [build_extractelement vec i name b] creates a
22802171 [%name = extractelement %vec, %i]
22812172 instruction at the position specified by the instruction builder [b].
23172208 See the method [llvm::LLVMBuilder::CreateIsNull]. *)
23182209 val build_is_null : llvalue -> string -> llbuilder -> llvalue
23192210
2320
23212211 (** [build_is_not_null val name b] creates a
23222212 [%name = icmp ne %val, null]
23232213 instruction at the position specified by the instruction builder [b].
23242214 See the method [llvm::LLVMBuilder::CreateIsNotNull]. *)
23252215 val build_is_not_null : llvalue -> string -> llbuilder -> llvalue
2326
23272216
23282217 (** [build_ptrdiff lhs rhs name b] creates a series of instructions that measure
23292218 the difference between two pointer values at the position specified by the
23302219 instruction builder [b].
23312220 See the method [llvm::LLVMBuilder::CreatePtrDiff]. *)
23322221 val build_ptrdiff : llvalue -> llvalue -> string -> llbuilder -> llvalue
2333
23342222
23352223
23362224 (** {6 Memory buffers} *)
23772265 See the constructor of [llvm::FunctionPassManager]. *)
23782266 val create_function : llmodule -> [ `Function ] t
23792267
2380
23812268 (** [run_module m pm] initializes, executes on the module [m], and finalizes
23822269 all of the passes scheduled in the pass manager [pm]. Returns [true] if
23832270 any of the passes modified the module, [false] otherwise.
23842271 See the [llvm::PassManager::run] method. *)
23852272 val run_module : llmodule -> [ `Module ] t -> bool
23862273
2387
23882274 (** [initialize fpm] initializes all of the function passes scheduled in the
23892275 function pass manager [fpm]. Returns [true] if any of the passes modified
23902276 the module, [false] otherwise.
23962282 of the passes modified [f], [false] otherwise.
23972283 See the [llvm::FunctionPassManager::run] method. *)
23982284 val run_function : llvalue -> [ `Function ] t -> bool
2399
24002285
24012286 (** [finalize fpm] finalizes all of the function passes scheduled in in the
24022287 function pass manager [fpm]. Returns [true] if any of the passes
596596 CAMLreturn(Val_int(0));
597597 }
598598
599 CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value name)
599 CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name)
600600 {
601 CAMLparam1(name);
601 CAMLparam1(Name);
602602 CAMLlocal1(Nodes);
603 Nodes = alloc(LLVMGetNamedMetadataNumOperands(M, String_val(name)), 0);
604 LLVMGetNamedMetadataOperands(M, String_val(name), (LLVMValueRef *) Nodes);
603 Nodes = alloc(LLVMGetNamedMetadataNumOperands(M, String_val(Name)), 0);
604 LLVMGetNamedMetadataOperands(M, String_val(Name), (LLVMValueRef *) Nodes);
605605 CAMLreturn(Nodes);
606606 }
607607 /*--... Operations on scalar constants .....................................--*/
19661966 return LLVMBuildPtrDiff(Builder_val(B), LHS, RHS, String_val(Name));
19671967 }
19681968
1969
19701969 /*===-- Memory buffers ----------------------------------------------------===*/
19711970
19721971 /* string -> llmemorybuffer