diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-10-07 17:31:42 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-10-07 17:31:42 +0000 |
commit | 19a8fc224c76025463dc959f74f78f54f0056054 (patch) | |
tree | b1151b7c8c7899327eda9b24b4903fd8b067f442 /bindings | |
parent | 28dd0960267160e14e27dc08170c4b1fcd38cc06 (diff) | |
download | external_llvm-19a8fc224c76025463dc959f74f78f54f0056054.zip external_llvm-19a8fc224c76025463dc959f74f78f54f0056054.tar.gz external_llvm-19a8fc224c76025463dc959f74f78f54f0056054.tar.bz2 |
C and Objective Caml bindings for GlobalVariable::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/ocaml/llvm/llvm.ml | 3 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm.mli | 3 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm_ocaml.c | 11 |
3 files changed, 17 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml index 0361001..9766d83 100644 --- a/bindings/ocaml/llvm/llvm.ml +++ b/bindings/ocaml/llvm/llvm.ml @@ -268,6 +268,9 @@ external visibility : llvalue -> visibility = "llvm_visibility" external set_visibility : visibility -> llvalue -> unit = "llvm_set_visibility" 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" +external set_global_constant : bool -> llvalue -> unit + = "llvm_set_global_constant" (*--... Operations on global variables .....................................--*) external declare_global : lltype -> string -> llmodule -> llvalue diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli index d2f6cb4..ae37e9d 100644 --- a/bindings/ocaml/llvm/llvm.mli +++ b/bindings/ocaml/llvm/llvm.mli @@ -251,6 +251,9 @@ external visibility : llvalue -> visibility = "llvm_visibility" external set_visibility : visibility -> llvalue -> unit = "llvm_set_visibility" 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" +external set_global_constant : bool -> llvalue -> unit + = "llvm_set_global_constant" (*--... Operations on global variables .....................................--*) external declare_global : lltype -> string -> llmodule -> llvalue diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 4d72182..61115f2 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -445,6 +445,17 @@ CAMLprim value llvm_set_thread_local(value IsThreadLocal, return Val_unit; } +/* llvalue -> bool */ +CAMLprim value llvm_is_global_constant(LLVMValueRef GlobalVar) { + return Val_bool(LLVMIsGlobalConstant(GlobalVar)); +} + +/* bool -> llvalue -> unit */ +CAMLprim value llvm_set_global_constant(value Flag, LLVMValueRef GlobalVar) { + LLVMSetGlobalConstant(GlobalVar, Bool_val(Flag)); + return Val_unit; +} + /*--... Operations on functions ............................................--*/ /* string -> lltype -> llmodule -> llvalue */ |