summaryrefslogtreecommitdiffstats
path: root/llvm/bindings
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-10-30 08:30:08 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-10-30 08:30:08 +0000
commite75657b72708519df2a1a165d9ac748819df2d37 (patch)
treeb3f8e56b4c58c7415fc66cf2d88581673642567d /llvm/bindings
parentf481471495d40e808de5c61a6c2310820f358346 (diff)
downloadbcm5719-llvm-e75657b72708519df2a1a165d9ac748819df2d37.tar.gz
bcm5719-llvm-e75657b72708519df2a1a165d9ac748819df2d37.zip
[OCaml] Expose LLVM{Get,Set}DLLStorageClass.
llvm-svn: 220902
Diffstat (limited to 'llvm/bindings')
-rw-r--r--llvm/bindings/ocaml/llvm/llvm.ml9
-rw-r--r--llvm/bindings/ocaml/llvm/llvm.mli17
-rw-r--r--llvm/bindings/ocaml/llvm/llvm_ocaml.c11
3 files changed, 37 insertions, 0 deletions
diff --git a/llvm/bindings/ocaml/llvm/llvm.ml b/llvm/bindings/ocaml/llvm/llvm.ml
index 567fa2fc9d9..8df34378b79 100644
--- a/llvm/bindings/ocaml/llvm/llvm.ml
+++ b/llvm/bindings/ocaml/llvm/llvm.ml
@@ -66,6 +66,13 @@ module Visibility = struct
| Protected
end
+module DLLStorageClass = struct
+ type t =
+ | Default
+ | DLLImport
+ | DLLExport
+end
+
module CallConv = struct
let c = 0
let fast = 8
@@ -575,6 +582,8 @@ external section : llvalue -> string = "llvm_section"
external set_section : string -> llvalue -> unit = "llvm_set_section"
external visibility : llvalue -> Visibility.t = "llvm_visibility"
external set_visibility : Visibility.t -> llvalue -> unit = "llvm_set_visibility"
+external dll_storage_class : llvalue -> DLLStorageClass.t = "llvm_dll_storage_class"
+external set_dll_storage_class : DLLStorageClass.t -> llvalue -> unit = "llvm_set_dll_storage_class"
external alignment : llvalue -> int = "llvm_alignment"
external set_alignment : int -> llvalue -> unit = "llvm_set_alignment"
external is_global_constant : llvalue -> bool = "llvm_is_global_constant"
diff --git a/llvm/bindings/ocaml/llvm/llvm.mli b/llvm/bindings/ocaml/llvm/llvm.mli
index 1d93fa332d2..e6514327128 100644
--- a/llvm/bindings/ocaml/llvm/llvm.mli
+++ b/llvm/bindings/ocaml/llvm/llvm.mli
@@ -105,6 +105,15 @@ module Visibility : sig
| Protected
end
+(** The DLL storage class of a global value, accessed with {!dll_storage_class} and
+ {!set_dll_storage_class}. See [llvm::GlobalValue::DLLStorageClassTypes]. *)
+module DLLStorageClass : sig
+ type t =
+ | Default
+ | DLLImport
+ | DLLExport
+end
+
(** The following calling convention values may be accessed with
{!function_call_conv} and {!set_function_call_conv}. Calling
conventions are open-ended. *)
@@ -1259,6 +1268,14 @@ val visibility : llvalue -> Visibility.t
[v]. See the method [llvm::GlobalValue::setVisibility]. *)
val set_visibility : Visibility.t -> llvalue -> unit
+(** [dll_storage_class g] returns the DLL storage class of the global value [g].
+ See the method [llvm::GlobalValue::getDLLStorageClass]. *)
+val dll_storage_class : llvalue -> DLLStorageClass.t
+
+(** [set_dll_storage_class v g] sets the DLL storage class of the global value [g] to
+ [v]. See the method [llvm::GlobalValue::setDLLStorageClass]. *)
+val set_dll_storage_class : DLLStorageClass.t -> llvalue -> unit
+
(** [alignment g] returns the required alignment of the global value [g].
See the method [llvm::GlobalValue::getAlignment]. *)
val alignment : llvalue -> int
diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
index 2348b6d1699..b43b3750734 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -957,6 +957,17 @@ CAMLprim value llvm_set_visibility(value Viz, LLVMValueRef Global) {
return Val_unit;
}
+/* llvalue -> DLLStorageClass.t */
+CAMLprim value llvm_dll_storage_class(LLVMValueRef Global) {
+ return Val_int(LLVMGetDLLStorageClass(Global));
+}
+
+/* DLLStorageClass.t -> llvalue -> unit */
+CAMLprim value llvm_set_dll_storage_class(value Viz, LLVMValueRef Global) {
+ LLVMSetDLLStorageClass(Global, Int_val(Viz));
+ return Val_unit;
+}
+
/* llvalue -> int */
CAMLprim value llvm_alignment(LLVMValueRef Global) {
return Val_int(LLVMGetAlignment(Global));
OpenPOWER on IntegriCloud