See the [llvm::ICmpInst::Predicate] enumeration. *)
module Icmp : sig
type t =
- | Eq
- | Ne
- | Ugt
- | Uge
- | Ult
- | Ule
- | Sgt
- | Sge
- | Slt
- | Sle
+ | Eq (* Equal *)
+ | Ne (* Not equal *)
+ | Ugt (* Unsigned greater than *)
+ | Uge (* Unsigned greater or equal *)
+ | Ult (* Unsigned less than *)
+ | Ule (* Unsigned less or equal *)
+ | Sgt (* Signed greater than *)
+ | Sge (* Signed greater or equal *)
+ | Slt (* Signed less than *)
+ | Sle (* Signed less or equal *)
end
(** The predicate for a floating-point comparison ([fcmp]) instruction.
+ Ordered means that neither operand is a QNAN while unordered means
+ that either operand may be a QNAN.
See the [llvm::FCmpInst::Predicate] enumeration. *)
module Fcmp : sig
type t =
- | False
- | Oeq
- | Ogt
- | Oge
- | Olt
- | Ole
- | One
- | Ord
- | Uno
- | Ueq
- | Ugt
- | Uge
- | Ult
- | Ule
- | Une
- | True
+ | False (* Always false *)
+ | Oeq (* Ordered and equal *)
+ | Ogt (* Ordered and greater than *)
+ | Oge (* Ordered and greater or equal *)
+ | Olt (* Ordered and less than *)
+ | Ole (* Ordered and less or equal *)
+ | One (* Ordered and not equal *)
+ | Ord (* Ordered (no operand is NaN) *)
+ | Uno (* Unordered (one operand at least is NaN) *)
+ | Ueq (* Unordered and equal *)
+ | Ugt (* Unordered and greater than *)
+ | Uge (* Unordered and greater or equal *)
+ | Ult (* Unordered and less than *)
+ | Ule (* Unordered and less or equal *)
+ | Une (* Unordered and not equal *)
+ | True (* Always true *)
end
(** The opcodes for LLVM instructions and constant expressions. *)
(** [mdkind_id context name] returns the MDKind ID that corresponds to the
name [name] in the context [context]. See the function
[llvm::LLVMContext::getMDKindID]. *)
-val mdkind_id : llcontext -> string -> int
+val mdkind_id : llcontext -> string -> llmdkind
(** {6 Modules} *)
[ty] and value [n]. See the method [llvm::ConstantFP::get]. *)
val const_float_of_string : lltype -> string -> llvalue
-
(** {7 Operations on composite constants} *)
(** [const_string c s] returns the constant [i8] array with the values of the
values [elts]. See the method [llvm::ConstantVector::get]. *)
val const_vector : llvalue array -> llvalue
+(** [string_of_const c] returns [Some str] if [c] is a string constant,
+ or [None] if this is not a string constant. *)
+val string_of_const : llvalue -> string option
+
+(** [const_element c] returns a constant for a specified index's element.
+ See the method ConstantDataSequential::getElementAsConstant. *)
+val const_element : llvalue -> int -> llvalue
+
(** {7 Constant expressions} *)
See the method [llvm::ConstantExpr::getAShr]. *)
val const_ashr : llvalue -> llvalue -> llvalue
-(** [const_gep pc indices] returns the constant [getElementPtr] of [p1] with the
+(** [const_gep pc indices] returns the constant [getElementPtr] of [pc] with the
constant integers indices from the array [indices].
See the method [llvm::ConstantExpr::getGetElementPtr]. *)
val const_gep : llvalue -> llvalue array -> llvalue
-(** [const_in_bounds_gep pc indices] returns the constant [getElementPtr] of [p1]
+(** [const_in_bounds_gep pc indices] returns the constant [getElementPtr] of [pc]
with the constant integers indices from the array [indices].
See the method [llvm::ConstantExpr::getInBoundsGetElementPtr]. *)
val const_in_bounds_gep : llvalue -> llvalue array -> llvalue
val build_shufflevector : llvalue -> llvalue -> llvalue -> string ->
llbuilder -> llvalue
-(** [build_insertvalue agg idx name b] creates a
+(** [build_extractvalue agg idx name b] creates a
[%name = extractvalue %agg, %idx]
instruction at the position specified by the instruction builder [b].
See the method [llvm::LLVMBuilder::CreateExtractValue]. *)