[llvm-commits] [llvm] r97609 - in /llvm/trunk: bindings/ocaml/bitreader/ bindings/ocaml/executionengine/ bindings/ocaml/llvm/ test/Bindings/Ocaml/
Erick Tryzelaar
idadesub at users.sourceforge.net
Tue Mar 2 15:59:00 PST 2010
Author: erickt
Date: Tue Mar 2 17:59:00 2010
New Revision: 97609
URL: http://llvm.org/viewvc/llvm-project?rev=97609&view=rev
Log:
Remove module providers from ocaml.
Modified:
llvm/trunk/bindings/ocaml/bitreader/bitreader_ocaml.c
llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.ml
llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.mli
llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c
llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml
llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
llvm/trunk/test/Bindings/Ocaml/bitreader.ml
llvm/trunk/test/Bindings/Ocaml/executionengine.ml
llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml
llvm/trunk/test/Bindings/Ocaml/vmcore.ml
Modified: llvm/trunk/bindings/ocaml/bitreader/bitreader_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitreader/bitreader_ocaml.c?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/bitreader/bitreader_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/bitreader/bitreader_ocaml.c Tue Mar 2 17:59:00 2010
@@ -46,17 +46,16 @@
/*===-- Modules -----------------------------------------------------------===*/
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
-CAMLprim value llvm_get_module_provider(LLVMContextRef C,
- LLVMMemoryBufferRef MemBuf) {
+CAMLprim value llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
CAMLparam0();
CAMLlocal2(Variant, MessageVal);
char *Message;
- LLVMModuleProviderRef MP;
- if (LLVMGetBitcodeModuleProviderInContext(C, MemBuf, &MP, &Message))
+ LLVMModuleRef M;
+ if (LLVMGetBitcodeModuleInContext(C, MemBuf, &M, &Message))
llvm_raise(llvm_bitreader_error_exn, Message);
- CAMLreturn((value) MP);
+ CAMLreturn((value) M);
}
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
Modified: llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.ml (original)
+++ llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.ml Tue Mar 2 17:59:00 2010
@@ -13,9 +13,8 @@
external register_exns : exn -> unit = "llvm_register_bitreader_exns"
let _ = register_exns (Error "")
-external get_module_provider : Llvm.llcontext -> Llvm.llmemorybuffer ->
- Llvm.llmoduleprovider
- = "llvm_get_module_provider"
+external get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
+ = "llvm_get_module"
external parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
= "llvm_parse_bitcode"
Modified: llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.mli?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.mli (original)
+++ llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.mli Tue Mar 2 17:59:00 2010
@@ -14,14 +14,12 @@
exception Error of string
-(** [get_module_provider context mb] reads the bitcode for a new
- module provider [m] from the memory buffer [mb] in the context [context].
- Returns [m] if successful, or raises [Error msg] otherwise, where [msg] is a
- description of the error encountered. See the function
- [llvm::getBitcodeModuleProvider]. *)
-external get_module_provider : Llvm.llcontext -> Llvm.llmemorybuffer ->
- Llvm.llmoduleprovider
- = "llvm_get_module_provider"
+(** [get_module context mb] reads the bitcode for a new module [m] from the
+ memory buffer [mb] in the context [context]. Returns [m] if successful, or
+ raises [Error msg] otherwise, where [msg] is a description of the error
+ encountered. See the function [llvm::getBitcodeModule]. *)
+external get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
+ = "llvm_get_module"
(** [parse_bitcode context mb] parses the bitcode for a new module [m] from the
memory buffer [mb] in the context [context]. Returns [m] if successful, or
Modified: llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c Tue Mar 2 17:59:00 2010
@@ -168,41 +168,41 @@
/*--... Operations on execution engines ....................................--*/
-/* llmoduleprovider -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef llvm_ee_create(LLVMModuleProviderRef MP) {
+/* llmodule -> ExecutionEngine.t */
+CAMLprim LLVMExecutionEngineRef llvm_ee_create(LLVMModuleRef M) {
LLVMExecutionEngineRef Interp;
char *Error;
- if (LLVMCreateExecutionEngine(&Interp, MP, &Error))
+ if (LLVMCreateExecutionEngineForModule(&Interp, M, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return Interp;
}
-/* llmoduleprovider -> ExecutionEngine.t */
+/* llmodule -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_interpreter(LLVMModuleProviderRef MP) {
+llvm_ee_create_interpreter(LLVMModuleRef M) {
LLVMExecutionEngineRef Interp;
char *Error;
- if (LLVMCreateInterpreter(&Interp, MP, &Error))
+ if (LLVMCreateInterpreterForModule(&Interp, M, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return Interp;
}
-/* llmoduleprovider -> ExecutionEngine.t */
+/* llmodule -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_jit(LLVMModuleProviderRef MP) {
+llvm_ee_create_jit(LLVMModuleRef M) {
LLVMExecutionEngineRef JIT;
char *Error;
- if (LLVMCreateJITCompiler(&JIT, MP, 3, &Error))
+ if (LLVMCreateJITCompilerForModule(&JIT, M, 3, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return JIT;
}
-/* llmoduleprovider -> ExecutionEngine.t */
+/* llmodule -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_fast_jit(LLVMModuleProviderRef MP) {
+llvm_ee_create_fast_jit(LLVMModuleRef M) {
LLVMExecutionEngineRef JIT;
char *Error;
- if (LLVMCreateJITCompiler(&JIT, MP, 0, &Error))
+ if (LLVMCreateJITCompiler(&JIT, M, 0, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return JIT;
}
@@ -213,19 +213,18 @@
return Val_unit;
}
-/* llmoduleprovider -> ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_add_mp(LLVMModuleProviderRef MP,
- LLVMExecutionEngineRef EE) {
- LLVMAddModuleProvider(EE, MP);
+/* llmodule -> ExecutionEngine.t -> unit */
+CAMLprim value llvm_ee_add_mp(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
+ LLVMAddModule(EE, M);
return Val_unit;
}
-/* llmoduleprovider -> ExecutionEngine.t -> llmodule */
-CAMLprim LLVMModuleRef llvm_ee_remove_mp(LLVMModuleProviderRef MP,
+/* llmodule -> ExecutionEngine.t -> llmodule */
+CAMLprim LLVMModuleRef llvm_ee_remove_mp(LLVMModuleRef M,
LLVMExecutionEngineRef EE) {
LLVMModuleRef RemovedModule;
char *Error;
- if (LLVMRemoveModuleProvider(EE, MP, &RemovedModule, &Error))
+ if (LLVMRemoveModule(EE, M, &RemovedModule, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return RemovedModule;
}
Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml (original)
+++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml Tue Mar 2 17:59:00 2010
@@ -56,19 +56,19 @@
call into LLVM. *)
let _ = register_exns (Error "")
- external create: Llvm.llmoduleprovider -> t
+ external create: Llvm.llmodule -> t
= "llvm_ee_create"
- external create_interpreter: Llvm.llmoduleprovider -> t
+ external create_interpreter: Llvm.llmodule -> t
= "llvm_ee_create_interpreter"
- external create_jit: Llvm.llmoduleprovider -> t
+ external create_jit: Llvm.llmodule -> t
= "llvm_ee_create_jit"
- external create_fast_jit: Llvm.llmoduleprovider -> t
+ external create_fast_jit: Llvm.llmodule -> t
= "llvm_ee_create_fast_jit"
external dispose: t -> unit
= "llvm_ee_dispose"
- external add_module_provider: Llvm.llmoduleprovider -> t -> unit
+ external add_module: Llvm.llmodule -> t -> unit
= "llvm_ee_add_mp"
- external remove_module_provider: Llvm.llmoduleprovider -> t -> Llvm.llmodule
+ external remove_module: Llvm.llmodule -> t -> Llvm.llmodule
= "llvm_ee_remove_mp"
external find_function: string -> t -> Llvm.llvalue option
= "llvm_ee_find_function"
Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli (original)
+++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli Tue Mar 2 17:59:00 2010
@@ -85,48 +85,47 @@
invoking a static compiler and generating a native executable. *)
type t
- (** [create mp] creates a new execution engine, taking ownership of the
- module provider [mp] if successful. Creates a JIT if possible, else falls
- back to an interpreter. Raises [Error msg] if an error occurrs. The
- execution engine is not garbage collected and must be destroyed with
- [dispose ee]. See the function [llvm::EngineBuilder::create]. *)
- val create: Llvm.llmoduleprovider -> t
+ (** [create m] creates a new execution engine, taking ownership of the
+ module [m] if successful. Creates a JIT if possible, else falls back to an
+ interpreter. Raises [Error msg] if an error occurrs. The execution engine
+ is not garbage collected and must be destroyed with [dispose ee].
+ See the function [llvm::EngineBuilder::create]. *)
+ val create: Llvm.llmodule -> t
- (** [create_interpreter mp] creates a new interpreter, taking ownership of the
- module provider [mp] if successful. Raises [Error msg] if an error
- occurrs. The execution engine is not garbage collected and must be
- destroyed with [dispose ee].
+ (** [create_interpreter m] creates a new interpreter, taking ownership of the
+ module [m] if successful. Raises [Error msg] if an error occurrs. The
+ execution engine is not garbage collected and must be destroyed with
+ [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
- val create_interpreter: Llvm.llmoduleprovider -> t
+ val create_interpreter: Llvm.llmodule -> t
- (** [create_jit mp] creates a new JIT (just-in-time compiler), taking
- ownership of the module provider [mp] if successful. This function creates
- a JIT which favors code quality over compilation speed. Raises [Error msg]
- if an error occurrs. The execution engine is not garbage collected and
- must be destroyed with [dispose ee].
+ (** [create_jit m] creates a new JIT (just-in-time compiler), taking
+ ownership of the module [m] if successful. This function creates a JIT
+ which favors code quality over compilation speed. Raises [Error msg] if an
+ error occurrs. The execution engine is not garbage collected and must be
+ destroyed with [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
- val create_jit: Llvm.llmoduleprovider -> t
+ val create_jit: Llvm.llmodule -> t
- (** [create_fast_jit mp] creates a new JIT (just-in-time compiler) which
+ (** [create_fast_jit m] creates a new JIT (just-in-time compiler) which
favors compilation speed over code quality. It takes ownership of the
- module provider [mp] if successful. Raises [Error msg] if an error
- occurrs. The execution engine is not garbage collected and must be
- destroyed with [dispose ee].
+ module [m] if successful. Raises [Error msg] if an error occurrs. The
+ execution engine is not garbage collected and must be destroyed with
+ [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
- val create_fast_jit: Llvm.llmoduleprovider -> t
+ val create_fast_jit: Llvm.llmodule -> t
(** [dispose ee] releases the memory used by the execution engine and must be
invoked to avoid memory leaks. *)
val dispose: t -> unit
- (** [add_module_provider mp ee] adds the module provider [mp] to the execution
- engine [ee]. *)
- val add_module_provider: Llvm.llmoduleprovider -> t -> unit
-
- (** [remove_module_provider mp ee] removes the module provider [mp] from the
- execution engine [ee], disposing of [mp] and the module referenced by
- [mp]. Raises [Error msg] if an error occurs. *)
- val remove_module_provider: Llvm.llmoduleprovider -> t -> Llvm.llmodule
+ (** [add_module m ee] adds the module [m] to the execution engine [ee]. *)
+ val add_module: Llvm.llmodule -> t -> unit
+
+ (** [remove_module m ee] removes the module [m] from the execution engine
+ [ee], disposing of [m] and the module referenced by [mp]. Raises
+ [Error msg] if an error occurs. *)
+ val remove_module: Llvm.llmodule -> t -> Llvm.llmodule
(** [find_function n ee] finds the function named [n] defined in any of the
modules owned by the execution engine [ee]. Returns [None] if the function
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml Tue Mar 2 17:59:00 2010
@@ -16,7 +16,6 @@
type lluse
type llbasicblock
type llbuilder
-type llmoduleprovider
type llmemorybuffer
module TypeKind = struct
@@ -948,14 +947,6 @@
external build_ptrdiff : llvalue -> llvalue -> string -> llbuilder -> llvalue
= "llvm_build_ptrdiff"
-(*===-- Module providers --------------------------------------------------===*)
-
-module ModuleProvider = struct
- external create : llmodule -> llmoduleprovider
- = "LLVMCreateModuleProviderForExistingModule"
- external dispose : llmoduleprovider -> unit = "llvm_dispose_module_provider"
-end
-
(*===-- Memory buffers ----------------------------------------------------===*)
@@ -972,7 +963,7 @@
type 'a t
type any = [ `Module | `Function ]
external create : unit -> [ `Module ] t = "llvm_passmanager_create"
- external create_function : llmoduleprovider -> [ `Function ] t
+ external create_function : llmodule -> [ `Function ] t
= "LLVMCreateFunctionPassManager"
external run_module : llmodule -> [ `Module ] t -> bool
= "llvm_passmanager_run_module"
Modified: llvm/trunk/bindings/ocaml/llvm/llvm.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm.mli?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli Tue Mar 2 17:59:00 2010
@@ -49,10 +49,6 @@
class. *)
type llbuilder
-(** Used to provide a module to JIT or interpreter.
- See the [llvm::ModuleProvider] class. *)
-type llmoduleprovider
-
(** Used to efficiently handle large buffers of read-only binary data.
See the [llvm::MemoryBuffer] class. *)
type llmemorybuffer
@@ -2198,20 +2194,6 @@
external build_ptrdiff : llvalue -> llvalue -> string -> llbuilder -> llvalue
= "llvm_build_ptrdiff"
-(** {6 Module providers} *)
-
-module ModuleProvider : sig
- (** [create_module_provider m] encapsulates [m] in a module provider and takes
- ownership of the module. See the constructor
- [llvm::ExistingModuleProvider::ExistingModuleProvider]. *)
- external create : llmodule -> llmoduleprovider
- = "LLVMCreateModuleProviderForExistingModule"
-
- (** [dispose_module_provider mp] destroys the module provider [mp] as well as
- the contained module. *)
- external dispose : llmoduleprovider -> unit = "llvm_dispose_module_provider"
-end
-
(** {6 Memory buffers} *)
@@ -2243,12 +2225,12 @@
See the constructor of [llvm::PassManager]. *)
external create : unit -> [ `Module ] t = "llvm_passmanager_create"
- (** [PassManager.create_function mp] constructs a new function-by-function
- pass pipeline over the module provider [mp]. It does not take ownership of
- [mp]. This type of pipeline is suitable for code generation and JIT
- compilation tasks.
+ (** [PassManager.create_function m] constructs a new function-by-function
+ pass pipeline over the module [m]. It does not take ownership of [m].
+ This type of pipeline is suitable for code generation and JIT compilation
+ tasks.
See the constructor of [llvm::FunctionPassManager]. *)
- external create_function : llmoduleprovider -> [ `Function ] t
+ external create_function : llmodule -> [ `Function ] t
= "LLVMCreateFunctionPassManager"
(** [run_module m pm] initializes, executes on the module [m], and finalizes
@@ -2278,7 +2260,7 @@
external finalize : [ `Function ] t -> bool = "llvm_passmanager_finalize"
(** Frees the memory of a pass pipeline. For function pipelines, does not free
- the module provider.
+ the module.
See the destructor of [llvm::BasePassManager]. *)
external dispose : [< any ] t -> unit = "llvm_passmanager_dispose"
end
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=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Tue Mar 2 17:59:00 2010
@@ -1752,14 +1752,6 @@
return LLVMBuildPtrDiff(Builder_val(B), LHS, RHS, String_val(Name));
}
-/*===-- Module Providers --------------------------------------------------===*/
-
-/* llmoduleprovider -> unit */
-CAMLprim value llvm_dispose_module_provider(LLVMModuleProviderRef MP) {
- LLVMDisposeModuleProvider(MP);
- return Val_unit;
-}
-
/*===-- Memory buffers ----------------------------------------------------===*/
Modified: llvm/trunk/test/Bindings/Ocaml/bitreader.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/bitreader.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/bitreader.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/bitreader.ml Tue Mar 2 17:59:00 2010
@@ -41,16 +41,16 @@
true
end;
- (* get_module_provider *)
+ (* get_module *)
begin
let mb = Llvm.MemoryBuffer.of_file fn in
- let mp = begin try
- Llvm_bitreader.get_module_provider context mb
+ let m = begin try
+ Llvm_bitreader.get_module context mb
with x ->
Llvm.MemoryBuffer.dispose mb;
raise x
end in
- Llvm.ModuleProvider.dispose mp
+ Llvm.dispose_module m
end;
(* corrupt the bitcode *)
@@ -60,17 +60,17 @@
close_out oc
end;
- (* test get_module_provider exceptions *)
+ (* test get_module exceptions *)
test begin
try
let mb = Llvm.MemoryBuffer.of_file fn in
- let mp = begin try
- Llvm_bitreader.get_module_provider context mb
+ let m = begin try
+ Llvm_bitreader.get_module context mb
with x ->
Llvm.MemoryBuffer.dispose mb;
raise x
end in
- Llvm.ModuleProvider.dispose mp;
+ Llvm.dispose_module m;
false
with Llvm_bitreader.Error _ ->
true
Modified: llvm/trunk/test/Bindings/Ocaml/executionengine.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/executionengine.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/executionengine.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/executionengine.ml Tue Mar 2 17:59:00 2010
@@ -64,9 +64,8 @@
let m2 = create_module (global_context ()) "test_module2" in
define_plus m2;
- let ee = ExecutionEngine.create (ModuleProvider.create m) in
- let mp2 = ModuleProvider.create m2 in
- ExecutionEngine.add_module_provider mp2 ee;
+ let ee = ExecutionEngine.create m in
+ ExecutionEngine.add_module m2 ee;
(* run_static_ctors *)
ExecutionEngine.run_static_ctors ee;
@@ -94,8 +93,8 @@
ee in
if 4 != GenericValue.as_int res then bomb "plus did not work";
- (* remove_module_provider *)
- Llvm.dispose_module (ExecutionEngine.remove_module_provider mp2 ee);
+ (* remove_module *)
+ Llvm.dispose_module (ExecutionEngine.remove_module m2 ee);
(* run_static_dtors *)
ExecutionEngine.run_static_dtors ee;
Modified: llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/scalar_opts.ml Tue Mar 2 17:59:00 2010
@@ -22,7 +22,6 @@
let filename = Sys.argv.(1)
let m = create_module context filename
-let mp = ModuleProvider.create m
(*===-- Transforms --------------------------------------------------------===*)
@@ -36,7 +35,7 @@
let td = TargetData.create (target_triple m) in
- ignore (PassManager.create_function mp
+ ignore (PassManager.create_function m
++ TargetData.add td
++ add_instruction_combining
++ add_reassociation
@@ -55,4 +54,4 @@
let _ =
suite "transforms" test_transforms;
- ModuleProvider.dispose mp
+ dispose_module m
Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=97609&r1=97608&r2=97609&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Tue Mar 2 17:59:00 2010
@@ -58,7 +58,6 @@
let filename = Sys.argv.(1)
let m = create_module context filename
-let mp = ModuleProvider.create m
(*===-- Target ------------------------------------------------------------===*)
@@ -1264,14 +1263,6 @@
end
-(*===-- Module Provider ---------------------------------------------------===*)
-
-let test_module_provider () =
- let m = create_module context "test" in
- let mp = ModuleProvider.create m in
- ModuleProvider.dispose mp
-
-
(*===-- Pass Managers -----------------------------------------------------===*)
let test_pass_manager () =
@@ -1288,7 +1279,7 @@
let fn = define_function "FunctionPassManager" fty m in
ignore (build_ret_void (builder_at_end context (entry_block fn)));
- ignore (PassManager.create_function mp
+ ignore (PassManager.create_function m
++ PassManager.initialize
++ PassManager.run_function fn
++ PassManager.finalize
@@ -1307,7 +1298,7 @@
group "writer";
insist (write_bitcode_file m filename);
- ModuleProvider.dispose mp
+ dispose_module m
(*===-- Driver ------------------------------------------------------------===*)
@@ -1326,7 +1317,6 @@
suite "basic blocks" test_basic_blocks;
suite "instructions" test_instructions;
suite "builder" test_builder;
- suite "module provider" test_module_provider;
suite "pass manager" test_pass_manager;
suite "writer" test_writer; (* Keep this last; it disposes m. *)
exit !exit_status
More information about the llvm-commits
mailing list