aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-10-06 00:08:49 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-10-06 00:08:49 +0000
commit88cc699942f7f972ef9bc3afa1df0a44d059e1d8 (patch)
treea2fd7394807637248221b71769b9d3c5490da2ce
parentacd96191cd8d85f376ec0baafdc4f21b3042f677 (diff)
Wrapping Value::dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42668 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--bindings/ocaml/llvm/llvm.ml1
-rw-r--r--bindings/ocaml/llvm/llvm.mli1
-rw-r--r--bindings/ocaml/llvm/llvm_ocaml.c6
-rw-r--r--include/llvm-c/Core.h1
-rw-r--r--lib/VMCore/Core.cpp4
5 files changed, 13 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml
index 63079f2107..5121291cea 100644
--- a/bindings/ocaml/llvm/llvm.ml
+++ b/bindings/ocaml/llvm/llvm.ml
@@ -181,6 +181,7 @@ let label_type = _label_type ()
external type_of : llvalue -> lltype = "llvm_type_of"
external value_name : llvalue -> string = "llvm_value_name"
external set_value_name : string -> llvalue -> unit = "llvm_set_value_name"
+external dump_value : llvalue -> unit = "llvm_dump_value"
(*--... Operations on constants of (mostly) any type .......................--*)
external is_constant : llvalue -> bool = "llvm_is_constant"
diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli
index 627594170b..85b93ae19d 100644
--- a/bindings/ocaml/llvm/llvm.mli
+++ b/bindings/ocaml/llvm/llvm.mli
@@ -164,6 +164,7 @@ val label_type : lltype
external type_of : llvalue -> lltype = "llvm_type_of"
external value_name : llvalue -> string = "llvm_value_name"
external set_value_name : string -> llvalue -> unit = "llvm_set_value_name"
+external dump_value : llvalue -> unit = "llvm_dump_value"
(*--... Operations on constants of (mostly) any type .......................--*)
external is_constant : llvalue -> bool = "llvm_is_constant"
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c
index f53ad3c6d3..bc6e0b70f0 100644
--- a/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/bindings/ocaml/llvm/llvm_ocaml.c
@@ -219,6 +219,12 @@ CAMLprim value llvm_set_value_name(value Name, LLVMValueRef Val) {
return Val_unit;
}
+/* llvalue -> unit */
+CAMLprim value llvm_dump_value(LLVMValueRef Val) {
+ LLVMDumpValue(Val);
+ return Val_unit;
+}
+
/*--... Operations on constants of (mostly) any type .......................--*/
/* llvalue -> bool */
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index fb01b83735..a9ed27b420 100644
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
@@ -225,6 +225,7 @@ LLVMTypeRef LLVMCreateOpaqueType();
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
const char *LLVMGetValueName(LLVMValueRef Val);
void LLVMSetValueName(LLVMValueRef Val, const char *Name);
+void LLVMDumpValue(LLVMValueRef Val);
/* Operations on constants of any type */
LLVMValueRef LLVMGetNull(LLVMTypeRef Ty); /* all zeroes */
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index b6a825462a..c63534df6c 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -194,6 +194,10 @@ void LLVMSetValueName(LLVMValueRef Val, const char *Name) {
unwrap(Val)->setName(Name);
}
+void LLVMDumpValue(LLVMValueRef Val) {
+ unwrap(Val)->dump();
+}
+
/*--.. Operations on constants of any type .................................--*/
LLVMValueRef LLVMGetNull(LLVMTypeRef Ty) {