From: Gordon Henriksen Date: Sat, 6 Oct 2007 00:08:49 +0000 (+0000) Subject: Wrapping Value::dump. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=88cc699942f7f972ef9bc3afa1df0a44d059e1d8 Wrapping Value::dump. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42668 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml index 63079f21072..5121291cea5 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 627594170b2..85b93ae19de 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 f53ad3c6d34..bc6e0b70f09 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 fb01b837352..a9ed27b4201 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 b6a825462ae..c63534df6c6 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) {