Convert the rest of the ocaml types and functions to use context.
[oota-llvm.git] / test / Bindings / Ocaml / target.ml
index 385bc8131e28579be0277f8e6914b1c9b4addd5c..f7d1cbf2859fa96b8eb8797854b33da21352ac90 100644 (file)
@@ -8,6 +8,10 @@
 open Llvm
 open Llvm_target
 
+let context = global_context ()
+let i32_type = Llvm.i32_type context
+let i64_type = Llvm.i64_type context
+
 (* Tiny unit test framework - really just to help find which line is busted *)
 let suite name f =
   prerr_endline (name ^ ":");
@@ -17,14 +21,14 @@ let suite name f =
 (*===-- Fixture -----------------------------------------------------------===*)
 
 let filename = Sys.argv.(1)
-let m = create_module (global_context ()) filename
+let m = create_module context filename
 
 
 (*===-- Target Data -------------------------------------------------------===*)
 
 let test_target_data () =
   let td = TargetData.create (target_triple m) in
-  let sty = struct_type (global_context ()) [| i32_type; i64_type |] in
+  let sty = struct_type context [| i32_type; i64_type |] in
   
   ignore (TargetData.as_string td);
   ignore (TargetData.invalidate_struct_layout td sty);