aboutsummaryrefslogtreecommitdiff
path: root/test/Bindings
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2010-03-02 23:59:00 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2010-03-02 23:59:00 +0000
commit16609f3c5c26ba34603ae0d7ebab86fb11a72722 (patch)
tree7072d503c07f4c3370ed067787f84d7cc93c0ff7 /test/Bindings
parentdf7df075b723e926e51555bf5aff6e231279a479 (diff)
Remove module providers from ocaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bindings')
-rw-r--r--test/Bindings/Ocaml/bitreader.ml16
-rw-r--r--test/Bindings/Ocaml/executionengine.ml9
-rw-r--r--test/Bindings/Ocaml/scalar_opts.ml5
-rw-r--r--test/Bindings/Ocaml/vmcore.ml14
4 files changed, 16 insertions, 28 deletions
diff --git a/test/Bindings/Ocaml/bitreader.ml b/test/Bindings/Ocaml/bitreader.ml
index 5c23041c80..112ca61830 100644
--- a/test/Bindings/Ocaml/bitreader.ml
+++ b/test/Bindings/Ocaml/bitreader.ml
@@ -41,16 +41,16 @@ let _ =
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 @@ let _ =
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
diff --git a/test/Bindings/Ocaml/executionengine.ml b/test/Bindings/Ocaml/executionengine.ml
index ce56c50dcb..2caeb82aac 100644
--- a/test/Bindings/Ocaml/executionengine.ml
+++ b/test/Bindings/Ocaml/executionengine.ml
@@ -64,9 +64,8 @@ let test_executionengine () =
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 @@ let test_executionengine () =
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;
diff --git a/test/Bindings/Ocaml/scalar_opts.ml b/test/Bindings/Ocaml/scalar_opts.ml
index 0a65810105..1b488c5b02 100644
--- a/test/Bindings/Ocaml/scalar_opts.ml
+++ b/test/Bindings/Ocaml/scalar_opts.ml
@@ -22,7 +22,6 @@ let suite name f =
let filename = Sys.argv.(1)
let m = create_module context filename
-let mp = ModuleProvider.create m
(*===-- Transforms --------------------------------------------------------===*)
@@ -36,7 +35,7 @@ let test_transforms () =
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 test_transforms () =
let _ =
suite "transforms" test_transforms;
- ModuleProvider.dispose mp
+ dispose_module m
diff --git a/test/Bindings/Ocaml/vmcore.ml b/test/Bindings/Ocaml/vmcore.ml
index d87e162b9c..506bf50e2a 100644
--- a/test/Bindings/Ocaml/vmcore.ml
+++ b/test/Bindings/Ocaml/vmcore.ml
@@ -58,7 +58,6 @@ let suite name f =
let filename = Sys.argv.(1)
let m = create_module context filename
-let mp = ModuleProvider.create m
(*===-- Target ------------------------------------------------------------===*)
@@ -1264,14 +1263,6 @@ let test_builder () =
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 test_pass_manager () =
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 @@ let test_writer () =
group "writer";
insist (write_bitcode_file m filename);
- ModuleProvider.dispose mp
+ dispose_module m
(*===-- Driver ------------------------------------------------------------===*)
@@ -1326,7 +1317,6 @@ let _ =
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