Commits
Joe Groff committed 8e56e45f226
SIL: Define a switch_oneof instruction.
This instruction encapsulates testing, branching, and destructuring a oneof, as in:
oneof Expr {
case True
case False
case IntLiteral(Int)
case StringLiteral(String)
}
sil @dispatch_expr : $(Expr) -> () {
entry(%expr : $Expr):
switch_oneof %expr, \
case #Expr.True!oneofelt : bb1, \
case #Expr.False!oneofelt : bb2, \
case #Expr.IntLiteral!oneofelt : bb3, \
default bb4
bb1:
...
bb2:
...
bb3(%int : $Int):
...
bb4:
...
}
Swift SVN r6329