[llvm-commits] [llvm] r79163 - in /llvm/trunk: bindings/ocaml/llvm/llvm.ml bindings/ocaml/llvm/llvm.mli bindings/ocaml/llvm/llvm_ocaml.c include/llvm-c/Core.h lib/VMCore/Core.cpp
Erick Tryzelaar
idadesub at users.sourceforge.net
Sat Aug 15 19:20:57 PDT 2009
Author: erickt
Date: Sat Aug 15 21:20:57 2009
New Revision: 79163
URL: http://llvm.org/viewvc/llvm-project?rev=79163&view=rev
Log:
Add an llvm-c function that lets you insert an instruction with a name.
Modified:
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
llvm/trunk/include/llvm-c/Core.h
llvm/trunk/lib/VMCore/Core.cpp
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=79163&r1=79162&r2=79163&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Sat Aug 15 21:20:57 2009
@@ -654,6 +654,8 @@
external position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit
= "llvm_position_builder"
external insertion_block : llbuilder -> llbasicblock = "llvm_insertion_block"
+external insert_into_builder : llvalue -> string -> llbuilder -> unit
+ = "llvm_insert_into_builder"
let builder_at ip =
let b = builder () in
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=79163&r1=79162&r2=79163&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Sat Aug 15 21:20:57 2009
@@ -1324,6 +1324,12 @@
See the method [llvm::LLVMBuilder::GetInsertBlock]. *)
external insertion_block : llbuilder -> llbasicblock = "llvm_insertion_block"
+(** [insert_into_builder i name b] inserts the specified instruction [i] at the
+ position specified by the instruction builder [b].
+ See the method [llvm::LLVMBuilder::Insert]. *)
+external insert_into_builder : llvalue -> string -> llbuilder -> unit
+ = "llvm_insert_into_builder"
+
(** {7 Terminators} *)
Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=79163&r1=79162&r2=79163&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Sat Aug 15 21:20:57 2009
@@ -917,6 +917,13 @@
return InsertBlock;
}
+/* llvalue -> string -> llbuilder -> unit */
+CAMLprim value llvm_insert_into_builder(LLVMValueRef I, value Name,
+ LLVMBuilderRef B) {
+ LLVMInsertIntoBuilderWithName(B, I, String_val(Name));
+ return Val_unit;
+}
+
/*--... Terminators ........................................................--*/
/* llbuilder -> llvalue */
Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=79163&r1=79162&r2=79163&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Sat Aug 15 21:20:57 2009
@@ -658,6 +658,8 @@
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder);
void LLVMClearInsertionPosition(LLVMBuilderRef Builder);
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr);
+void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr,
+ const char *Name);
void LLVMDisposeBuilder(LLVMBuilderRef Builder);
/* Terminators */
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=79163&r1=79162&r2=79163&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Sat Aug 15 21:20:57 2009
@@ -1464,6 +1464,11 @@
unwrap(Builder)->Insert(unwrap<Instruction>(Instr));
}
+void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr,
+ const char *Name) {
+ unwrap(Builder)->Insert(unwrap<Instruction>(Instr), Name);
+}
+
void LLVMDisposeBuilder(LLVMBuilderRef Builder) {
delete unwrap(Builder);
}
More information about the llvm-commits
mailing list