llvm.org GIT mirror llvm / 6b84161
[OCaml] Documentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193967 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 7 years ago
2 changed file(s) with 19 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
117117 convention from C. *)
118118 end
119119
120 (** The attribute kind of a function parameter, result or the function itself.
121 See [llvm::Attribute::AttrKind]. *)
120122 module Attribute : sig
121123 type t =
122124 | Zext
632634 See the method [llvm::Value::getType]. *)
633635 val type_of : llvalue -> lltype
634636
637 (** [classify_value v] returns the kind of the value [v]. *)
635638 val classify_value : llvalue -> ValueKind.t
636639
637640 (** [value_name v] returns the name of the value [v]. For global values, this is
731734 otherwise. Similar to [llvm::isa]. *)
732735 val is_undef : llvalue -> bool
733736
737 (** [constexpr_opcode v] returns an [Opcode.t] corresponding to constexpr
738 value [v], or [Opcode.Invalid] if [v] is not a constexpr. *)
734739 val constexpr_opcode : llvalue -> Opcode.t
735740
736741
770775 See the method [llvm::MDString::getString] *)
771776 val get_mdstring : llvalue -> string option
772777
773 (** [get_named_metadata m name] return all the MDNodes belonging to the named
778 (** [get_named_metadata m name] returns all the MDNodes belonging to the named
774779 metadata (if any).
775780 See the method [llvm::NamedMDNode::getOperand]. *)
776781 val get_named_metadata : llmodule -> string -> llvalue array
15771582 See the method [llvm::Function::end]. *)
15781583 val block_end : llvalue -> (llvalue, llbasicblock) llrev_pos
15791584
1580 (** [block_pred gv] returns the function list position preceding [After gv].
1585 (** [block_pred bb] returns the basic block list position preceding [After bb].
15811586 See the method [llvm::Function::iterator::operator--]. *)
15821587 val block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos
15831588
1589 (** [block_terminator bb] returns the terminator of the basic block [bb]. *)
15841590 val block_terminator : llbasicblock -> llvalue option
15851591
15861592 (** [rev_iter_blocks f fn] applies function [f] to each of the basic blocks
16081614 (** [instr_parent i] is the enclosing basic block of the instruction [i].
16091615 See the method [llvm::Instruction::getParent]. *)
16101616 val instr_parent : llvalue -> llbasicblock
1617
1618 (** [delete_instruction i] deletes the instruction [i].
1619 * See the method [llvm::Instruction::eraseFromParent]. *)
1620 val delete_instruction : llvalue -> unit
16111621
16121622 (** [instr_begin bb] returns the first position in the instruction list of the
16131623 basic block [bb]. [instr_begin] and [instr_succ] can be used to iterate over
16411651 [f1,...,fN] are the instructions of basic block [bb]. Tail recursive. *)
16421652 val fold_right_instrs: (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a
16431653
1654 (** [inst_opcode i] returns the [Opcode.t] corresponding to instruction [i],
1655 or [Opcode.Invalid] if [i] is not an instruction. *)
16441656 val instr_opcode : llvalue -> Opcode.t
16451657
1658 (** [icmp_predicate i] returns the [Icmp.t] corresponding to an [icmp]
1659 instruction [i]. *)
16461660 val icmp_predicate : llvalue -> Icmp.t option
16471661
16481662
16721686 val remove_instruction_param_attr : llvalue -> int -> Attribute.t -> unit
16731687
16741688
1675 (** {Operations on call instructions (only)} *)
1689 (** {7 Operations on call instructions (only)} *)
16761690
16771691 (** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as
16781692 eligible for tail call optimization, [false] otherwise.
17101724 See the method [llvm::PHINode::getIncomingValue]. *)
17111725 val incoming : llvalue -> (llvalue * llbasicblock) list
17121726
1713 (** [delete_instruction i] deletes the instruction [i].
1714 * See the method [llvm::Instruction::eraseFromParent]. *)
1715 val delete_instruction : llvalue -> unit
17161727
17171728
17181729 (** {6 Instruction builders} *)
634634 CAMLreturn(Val_int(0));
635635 }
636636
637 /* llmodule -> string -> llvalue array */
637638 CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name)
638639 {
639640 CAMLparam1(Name);
12671268 return Val_int(o);
12681269 }
12691270
1270 /* llvalue -> ICmp.t */
1271 /* llvalue -> ICmp.t option */
12711272 CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
12721273 CAMLparam0();
12731274 int x = LLVMGetICmpPredicate(Val);