progs/fun_llvm.scala
changeset 705 bfc8703b1527
parent 701 681c36b2af27
--- a/progs/fun_llvm.scala	Sat Dec 07 00:57:23 2019 +0000
+++ b/progs/fun_llvm.scala	Sat Dec 14 17:57:43 2019 +0000
@@ -138,7 +138,7 @@
 val e7 = Call("foo", List(Num(3)))
 CPSi(e7)
 
-val e8 = Call("foo", List(Num(3), Num(4), Aop("+", Num(5), Num(6))))
+val e8 = Call("foo", List(Aop("*", Num(3), Num(1)), Num(4), Aop("+", Num(5), Num(6))))
 CPSi(e8)
 
 val e9 = Sequence(Aop("*", Var("a"), Num(3)), Aop("+", Var("b"), Num(6)))
@@ -239,6 +239,16 @@
   (end - start)/(i * 1.0e9)
 }
 
+// for Scala 2.12
+/*
+def deserialise[T](file: String) : Try[T] = {
+    val in = new ObjectInputStream(new FileInputStream(new File(file)))
+    val obj = Try(in.readObject().asInstanceOf[T])
+    in.close()
+    obj
+}
+*/
+
 def deserialise[T](fname: String) : Try[T] = {
   import scala.util.Using
   Using(new ObjectInputStream(new FileInputStream(fname))) {