1. camlspotter
  2. ocaml-llvm-phantom

Commits

camlspotter  committed 8164927

example cleanup

  • Participants
  • Parent commits 6fb8453
  • Branches default

Comments (0)

Files changed (1)

File examples/double_phantom.ml

View file
  • Ignore whitespace
-open Llvm
 open Llvm_phantom
 
 module P = Spotlib.Spot.Phantom
 open Type
 open Value
 
-module M = CreateModule(struct
+include CreateModule(struct
   let name = "mymodule"
   let opt = true
 end)
-open M.Monad.Open
+open Monad.Open
  
-let double = M.Monad.run (M.func "double" i32 (P.c1 (P.combine "param" i32)) ~dump:true (fun 
+let double = Monad.run (func "double" i32 (P.c1 (P.combine "param" i32)) ~dump:true (fun 
   _self (* for recursion (not used here) *) 
   vs (* parameters *) -> 
     let param = P.d1 vs in
-    M.mul param (Const.i32_of_int 2)))
+    mul param (Const.i32_of_int 2)))
 
-let res = Genvalue.as_int (M.ExecutionEngine.run_function double (P.c1 (Genvalue.of_int i32 21)))
+let res = Genvalue.as_int (ExecutionEngine.run_function double (P.c1 (Genvalue.of_int i32 21)))
 
 let () = Printf.eprintf "double(21)=%d\n" res