Advertisement
Guest User

Untitled

a guest
May 9th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.46 KB | None | 0 0
  1.  
  2. sealed abstract class Terminator() {
  3.   override def toString = this match {
  4.     case Jump(b)         => "jump " + b.id
  5.     case Cond(c, b1, b2) => "cond " + b1.id + "/" + b2.id
  6.     case Return(v)       => "retn"
  7.   }
  8. }
  9.  
  10. case class Jump(val target: BasicBlock) extends Terminator()
  11. case class Cond(val cond: Value, val arm1: BasicBlock, val arm2: BasicBlock) extends Terminator() with Use
  12. case class Return(val value: Value) extends Terminator() with Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement