aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/ocaml/llvm/llvm_ocaml.c
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-27 20:13:47 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-27 20:13:47 +0000
commit2476de6ea689c0a004547564677c275d480419d3 (patch)
tree054cd740a91cb46aa8c2a2a06a55510aff2864ce /bindings/ocaml/llvm/llvm_ocaml.c
parentc19a9cb76905b22abde0c4ca8ccd376daa643cd1 (diff)
downloadexternal_llvm-2476de6ea689c0a004547564677c275d480419d3.zip
external_llvm-2476de6ea689c0a004547564677c275d480419d3.tar.gz
external_llvm-2476de6ea689c0a004547564677c275d480419d3.tar.bz2
Adding bindings for target triple and data layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45369 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml/llvm/llvm_ocaml.c')
-rw-r--r--bindings/ocaml/llvm/llvm_ocaml.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c
index d8856e7..d095550 100644
--- a/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/bindings/ocaml/llvm/llvm_ocaml.c
@@ -62,6 +62,28 @@ CAMLprim value llvm_dispose_module(LLVMModuleRef M) {
return Val_unit;
}
+/* llmodule -> string */
+CAMLprim value llvm_target_triple(LLVMModuleRef M) {
+ return copy_string(LLVMGetTarget(M));
+}
+
+/* string -> llmodule -> unit */
+CAMLprim value llvm_set_target_triple(value Trip, LLVMModuleRef M) {
+ LLVMSetTarget(M, String_val(Trip));
+ return Val_unit;
+}
+
+/* llmodule -> string */
+CAMLprim value llvm_data_layout(LLVMModuleRef M) {
+ return copy_string(LLVMGetDataLayout(M));
+}
+
+/* string -> llmodule -> unit */
+CAMLprim value llvm_set_data_layout(value Layout, LLVMModuleRef M) {
+ LLVMSetDataLayout(M, String_val(Layout));
+ return Val_unit;
+}
+
/* string -> lltype -> llmodule -> bool */
CAMLprim value llvm_add_type_name(value Name, LLVMTypeRef Ty, LLVMModuleRef M) {
int res = LLVMAddTypeName(M, String_val(Name), Ty);