[OCaml] Documentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193967 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Zotov 2013-11-04 01:39:31 +00:00
parent 8a3bdd6a3f
commit 6b8416192a
2 changed files with 19 additions and 7 deletions

View File

@ -118,6 +118,8 @@ module CallConv : sig
convention from C. *) convention from C. *)
end end
(** The attribute kind of a function parameter, result or the function itself.
See [llvm::Attribute::AttrKind]. *)
module Attribute : sig module Attribute : sig
type t = type t =
| Zext | Zext
@ -633,6 +635,7 @@ val type_by_name : llmodule -> string -> lltype option
See the method [llvm::Value::getType]. *) See the method [llvm::Value::getType]. *)
val type_of : llvalue -> lltype val type_of : llvalue -> lltype
(** [classify_value v] returns the kind of the value [v]. *)
val classify_value : llvalue -> ValueKind.t val classify_value : llvalue -> ValueKind.t
(** [value_name v] returns the name of the value [v]. For global values, this is (** [value_name v] returns the name of the value [v]. For global values, this is
@ -732,6 +735,8 @@ val is_null : llvalue -> bool
otherwise. Similar to [llvm::isa<UndefValue>]. *) otherwise. Similar to [llvm::isa<UndefValue>]. *)
val is_undef : llvalue -> bool val is_undef : llvalue -> bool
(** [constexpr_opcode v] returns an [Opcode.t] corresponding to constexpr
value [v], or [Opcode.Invalid] if [v] is not a constexpr. *)
val constexpr_opcode : llvalue -> Opcode.t val constexpr_opcode : llvalue -> Opcode.t
@ -771,7 +776,7 @@ val mdnode : llcontext -> llvalue array -> llvalue
See the method [llvm::MDString::getString] *) See the method [llvm::MDString::getString] *)
val get_mdstring : llvalue -> string option val get_mdstring : llvalue -> string option
(** [get_named_metadata m name] return all the MDNodes belonging to the named (** [get_named_metadata m name] returns all the MDNodes belonging to the named
metadata (if any). metadata (if any).
See the method [llvm::NamedMDNode::getOperand]. *) See the method [llvm::NamedMDNode::getOperand]. *)
val get_named_metadata : llmodule -> string -> llvalue array val get_named_metadata : llmodule -> string -> llvalue array
@ -1578,10 +1583,11 @@ val fold_left_blocks : ('a -> llbasicblock -> 'a) -> 'a -> llvalue -> 'a
See the method [llvm::Function::end]. *) See the method [llvm::Function::end]. *)
val block_end : llvalue -> (llvalue, llbasicblock) llrev_pos val block_end : llvalue -> (llvalue, llbasicblock) llrev_pos
(** [block_pred gv] returns the function list position preceding [After gv]. (** [block_pred bb] returns the basic block list position preceding [After bb].
See the method [llvm::Function::iterator::operator--]. *) See the method [llvm::Function::iterator::operator--]. *)
val block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos val block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos
(** [block_terminator bb] returns the terminator of the basic block [bb]. *)
val block_terminator : llbasicblock -> llvalue option val block_terminator : llbasicblock -> llvalue option
(** [rev_iter_blocks f fn] applies function [f] to each of the basic blocks (** [rev_iter_blocks f fn] applies function [f] to each of the basic blocks
@ -1610,6 +1616,10 @@ val block_of_value : llvalue -> llbasicblock
See the method [llvm::Instruction::getParent]. *) See the method [llvm::Instruction::getParent]. *)
val instr_parent : llvalue -> llbasicblock val instr_parent : llvalue -> llbasicblock
(** [delete_instruction i] deletes the instruction [i].
* See the method [llvm::Instruction::eraseFromParent]. *)
val delete_instruction : llvalue -> unit
(** [instr_begin bb] returns the first position in the instruction list of the (** [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 basic block [bb]. [instr_begin] and [instr_succ] can be used to iterate over
the instruction list in order. the instruction list in order.
@ -1642,8 +1652,12 @@ val instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos
[f1,...,fN] are the instructions of basic block [bb]. Tail recursive. *) [f1,...,fN] are the instructions of basic block [bb]. Tail recursive. *)
val fold_right_instrs: (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a val fold_right_instrs: (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a
(** [inst_opcode i] returns the [Opcode.t] corresponding to instruction [i],
or [Opcode.Invalid] if [i] is not an instruction. *)
val instr_opcode : llvalue -> Opcode.t val instr_opcode : llvalue -> Opcode.t
(** [icmp_predicate i] returns the [Icmp.t] corresponding to an [icmp]
instruction [i]. *)
val icmp_predicate : llvalue -> Icmp.t option val icmp_predicate : llvalue -> Icmp.t option
@ -1673,7 +1687,7 @@ val add_instruction_param_attr : llvalue -> int -> Attribute.t -> unit
val remove_instruction_param_attr : llvalue -> int -> Attribute.t -> unit val remove_instruction_param_attr : llvalue -> int -> Attribute.t -> unit
(** {Operations on call instructions (only)} *) (** {7 Operations on call instructions (only)} *)
(** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as (** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as
eligible for tail call optimization, [false] otherwise. eligible for tail call optimization, [false] otherwise.
@ -1711,9 +1725,6 @@ val add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
See the method [llvm::PHINode::getIncomingValue]. *) See the method [llvm::PHINode::getIncomingValue]. *)
val incoming : llvalue -> (llvalue * llbasicblock) list val incoming : llvalue -> (llvalue * llbasicblock) list
(** [delete_instruction i] deletes the instruction [i].
* See the method [llvm::Instruction::eraseFromParent]. *)
val delete_instruction : llvalue -> unit
(** {6 Instruction builders} *) (** {6 Instruction builders} *)

View File

@ -635,6 +635,7 @@ CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
CAMLreturn(Val_int(0)); CAMLreturn(Val_int(0));
} }
/* llmodule -> string -> llvalue array */
CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name) CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name)
{ {
CAMLparam1(Name); CAMLparam1(Name);
@ -1268,7 +1269,7 @@ CAMLprim value llvm_instr_get_opcode(LLVMValueRef Inst) {
return Val_int(o); return Val_int(o);
} }
/* llvalue -> ICmp.t */ /* llvalue -> ICmp.t option */
CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) { CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
CAMLparam0(); CAMLparam0();
int x = LLVMGetICmpPredicate(Val); int x = LLVMGetICmpPredicate(Val);