ocaml bindings: introduce classify_value
[oota-llvm.git] / bindings / ocaml / llvm / llvm.mli
index 2e2db6e531014de1f8dd74e1c36d6b1531767527..2cfafdc89a59c0339a3dffee4beba6943d2958f5 100644 (file)
@@ -251,6 +251,31 @@ module Opcode : sig
   | Unwind
 end
 
+(** The kind of an [llvalue], the result of [classify_value v].
+ * See the various [LLVMIsA*] functions. *)
+module ValueKind : sig
+  type t =
+  | NullValue
+  | Argument
+  | BasicBlock
+  | InlineAsm
+  | MDNode
+  | MDString
+  | BlockAddress
+  | ConstantAggregateZero
+  | ConstantArray
+  | ConstantExpr
+  | ConstantFP
+  | ConstantInt
+  | ConstantPointerNull
+  | ConstantStruct
+  | ConstantVector
+  | Function
+  | GlobalAlias
+  | GlobalVariable
+  | UndefValue
+  | Instruction of Opcode.t
+end
 
 (** {6 Iteration} *)
 
@@ -518,6 +543,8 @@ val label_type : llcontext -> lltype
     See the method [llvm::Value::getType]. *)
 val type_of : llvalue -> lltype
 
+val classify_value : llvalue -> ValueKind.t
+
 (** [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.