progs/fun_llvm.scala
changeset 650 3031e3379ea3
parent 649 e83afb44f276
child 653 9d7843934d30
equal deleted inserted replaced
649:e83afb44f276 650:3031e3379ea3
   139   case KLet(x: String, e1: KExp, e2: KExp) => {
   139   case KLet(x: String, e1: KExp, e2: KExp) => {
   140     val is1 = compile_exp(e1)
   140     val is1 = compile_exp(e1)
   141     val is2 = compile_exp(e2)
   141     val is2 = compile_exp(e2)
   142     i"%$x = $is1" ++ is2
   142     i"%$x = $is1" ++ is2
   143   }
   143   }
       
   144   case KLet(x: String, e1: KExp, e2: KExp) => {
       
   145     val is1 = compile_exp(e1)
       
   146     val is2 = compile_exp(e2)
       
   147     i"%$x = $is1" ++ is2
       
   148   }
   144   case KIfeq(x1, x2, a1, a2) => {
   149   case KIfeq(x1, x2, a1, a2) => {
   145     val if_br = Fresh("if_br")
   150     val if_br = Fresh("if_br")
   146     val else_br = Fresh("else_br")
   151     val else_br = Fresh("else_br")
   147     val x = Fresh("tmp")
   152     val x = Fresh("tmp")
   148     i"%$x = icmp eq i32 %$x1, i32 %$x2" ++
   153     i"%$x = icmp eq i32 %$x1, i32 %$x2" ++