[OCaml] Add Llvm.instr_clone.
[oota-llvm.git] / bindings / ocaml / llvm / llvm_ocaml.c
index f0143a01a9be03659fd2690bffb3d2aaaf0797fd..a8f7b782a187f8cd1539ed8b104e4a46aae8e3c8 100644 (file)
@@ -1358,6 +1358,13 @@ CAMLprim value llvm_instr_icmp_predicate(LLVMValueRef Val) {
   CAMLreturn(Val_int(0));
 }
 
+/* llvalue -> llvalue */
+CAMLprim LLVMValueRef llvm_instr_clone(LLVMValueRef Inst) {
+  if (!LLVMIsAInstruction(Inst))
+      failwith("Not an instruction");
+  return LLVMInstructionClone(Inst);
+}
+
 
 /*--... Operations on call sites ...........................................--*/