[PATCH] D101639: Add build_fence to OCaml bindings
Francesco Bertolaccini via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 1 10:38:26 PDT 2021
frabert updated this revision to Diff 342163.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101639/new/
https://reviews.llvm.org/D101639
Files:
llvm/bindings/ocaml/llvm/llvm.ml
llvm/bindings/ocaml/llvm/llvm.mli
llvm/bindings/ocaml/llvm/llvm_ocaml.c
Index: llvm/bindings/ocaml/llvm/llvm_ocaml.c
===================================================================
--- llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -2457,6 +2457,13 @@
return LLVMBuildFreeze(Builder_val(B), X, String_val(Name));
}
+/* AtomicOrdering.t -> bool -> string -> llbuilder -> llvalue */
+CAMLprim LLVMValueRef llvm_build_fence(value Ord, value ST, value Name,
+ value B) {
+ return LLVMBuildFence(Builder_val(B), Int_val(Ord), Bool_val(ST),
+ String_val(Name));
+}
+
/*===-- Memory buffers ----------------------------------------------------===*/
/* string -> llmemorybuffer
Index: llvm/bindings/ocaml/llvm/llvm.mli
===================================================================
--- llvm/bindings/ocaml/llvm/llvm.mli
+++ llvm/bindings/ocaml/llvm/llvm.mli
@@ -2597,6 +2597,11 @@
See the method [llvm::LLVMBuilder::CreateFreeze]. *)
val build_freeze : llvalue -> string -> llbuilder -> llvalue
+(** [build_fence ord st name b] creates a
+ [%fence %]
+ instruction at the position specified by the instruction builder [b].
+ See the method [llvm::LLVMBuilder::CreateFence]. *)
+val build_fence : AtomicOrdering.t -> bool -> string -> llbuilder -> llvalue
(** {6 Memory buffers} *)
Index: llvm/bindings/ocaml/llvm/llvm.ml
===================================================================
--- llvm/bindings/ocaml/llvm/llvm.ml
+++ llvm/bindings/ocaml/llvm/llvm.ml
@@ -1348,6 +1348,8 @@
= "llvm_build_extractvalue"
external build_insertvalue : llvalue -> llvalue -> int -> string -> llbuilder ->
llvalue = "llvm_build_insertvalue"
+external build_fence : AtomicOrdering.t -> bool -> -> string -> llbuilder ->
+ llvalue = "llvm_build_fence"
external build_is_null : llvalue -> string -> llbuilder -> llvalue
= "llvm_build_is_null"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101639.342163.patch
Type: text/x-patch
Size: 1996 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210501/59263147/attachment.bin>
More information about the llvm-commits
mailing list