Commit Graph

3 Commits

Author SHA1 Message Date
Slava Pestov
f5f715f8ff SILGen: Support multiple-entry case blocks with address-only bindings
Fixes <rdar://problem/30870493>, <https://bugs.swift.org/browse/SR-4163>.
2018-01-17 21:02:08 -08:00
Joe Groff
a49dbfc747 Remove soon-to-be-obsolete 'switch' tests.
We can rebuild it.

Swift SVN r5781
2013-06-24 17:17:41 +00:00
Joe Groff
062ad267c4 Value-only switch statements.
Implement switch statements with simple value comparison to get the drudge work of parsing and generating switches in place. Cases are checked using a '=~' operator to compare the subject of the switch to the value in the case. Unlike a C switch, cases each have their own scope and don't fall through. 'break' and 'continue' apply to an outer loop rather to the switch itself. Multiple case values can be specified in a comma-separated list, as in 'case 1, 2, 3, 4:'. Currently no effort is made to check for duplicate cases or to rank cases by match strength; cases are just checked in source order, and the first one wins (aside from 'default', which is branched to if all cases fail).

Swift SVN r4359
2013-03-12 04:43:01 +00:00