[llvm] 1465b8b - [Test] Fix freeze ocaml test failure
Juneyoung Lee via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 05:34:52 PST 2019
Author: Juneyoung Lee
Date: 2019-11-22T22:34:37+09:00
New Revision: 1465b8bc3a2435eab46582616bdf7c6aee117e8d
URL: https://github.com/llvm/llvm-project/commit/1465b8bc3a2435eab46582616bdf7c6aee117e8d
DIFF: https://github.com/llvm/llvm-project/commit/1465b8bc3a2435eab46582616bdf7c6aee117e8d.diff
LOG: [Test] Fix freeze ocaml test failure
Added:
Modified:
llvm/bindings/ocaml/llvm/llvm.ml
llvm/bindings/ocaml/llvm/llvm.mli
llvm/bindings/ocaml/llvm/llvm_ocaml.c
llvm/test/Bindings/OCaml/core.ml
Removed:
################################################################################
diff --git a/llvm/bindings/ocaml/llvm/llvm.ml b/llvm/bindings/ocaml/llvm/llvm.ml
index f3ff600bde4f..fdef6eb176d6 100644
--- a/llvm/bindings/ocaml/llvm/llvm.ml
+++ b/llvm/bindings/ocaml/llvm/llvm.ml
@@ -1355,6 +1355,8 @@ external build_is_not_null : llvalue -> string -> llbuilder -> llvalue
= "llvm_build_is_not_null"
external build_ptr
diff : llvalue -> llvalue -> string -> llbuilder -> llvalue
= "llvm_build_ptr
diff "
+external build_freeze : llvalue -> string -> llbuilder -> llvalue
+ = "llvm_build_freeze"
(*===-- Memory buffers ----------------------------------------------------===*)
diff --git a/llvm/bindings/ocaml/llvm/llvm.mli b/llvm/bindings/ocaml/llvm/llvm.mli
index 6e145fa44f04..48e099faf100 100644
--- a/llvm/bindings/ocaml/llvm/llvm.mli
+++ b/llvm/bindings/ocaml/llvm/llvm.mli
@@ -2591,6 +2591,12 @@ val build_is_not_null : llvalue -> string -> llbuilder -> llvalue
See the method [llvm::LLVMBuilder::CreatePtrDiff]. *)
val build_ptr
diff : llvalue -> llvalue -> string -> llbuilder -> llvalue
+(** [build_freeze x name b] creates a
+ [%name = freeze %x]
+ instruction at the position specified by the instruction builder [b].
+ See the method [llvm::LLVMBuilder::CreateFreeze]. *)
+val build_freeze : llvalue -> string -> llbuilder -> llvalue
+
(** {6 Memory buffers} *)
diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
index 6af34bd9c172..1552abf29c03 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -2451,6 +2451,12 @@ CAMLprim LLVMValueRef llvm_build_ptr
diff (LLVMValueRef LHS, LLVMValueRef RHS,
return LLVMBuildPtrDiff(Builder_val(B), LHS, RHS, String_val(Name));
}
+/* llvalue -> string -> llbuilder -> llvalue */
+CAMLprim LLVMValueRef llvm_build_freeze(LLVMValueRef X,
+ value Name, value B) {
+ return LLVMBuildFreeze(Builder_val(B), X, String_val(Name));
+}
+
/*===-- Memory buffers ----------------------------------------------------===*/
/* string -> llmemorybuffer
diff --git a/llvm/test/Bindings/OCaml/core.ml b/llvm/test/Bindings/OCaml/core.ml
index 95d485ae76d2..86f865267cfa 100644
--- a/llvm/test/Bindings/OCaml/core.ml
+++ b/llvm/test/Bindings/OCaml/core.ml
@@ -1370,6 +1370,7 @@ let test_builder () =
* CHECK: %build_nuw_neg = sub nuw i32 0, %P1
* CHECK: %build_fneg = fneg float %F1
* CHECK: %build_not = xor i32 %P1, -1
+ * CHECK: %build_freeze = freeze i32 %P1
*)
ignore (build_add p1 p2 "build_add" b);
ignore (build_nsw_add p1 p2 "build_nsw_add" b);
More information about the llvm-commits
mailing list