Commits

Jordan Rose committed 4f6b85c32cf
Add a new OptionalEnum type to encapsulate the "enum-value-or-nothing" pattern. This implements the logic of storing "absent" values as 0 and "present" values as the enumerator's underlying value plus 1. For enums whose raw values are arbitrary or small, this is a safe, space-efficient way to add the "absent" value. The type has been designed to be used with PointerIntPair, so it converts (explicitly) to intptr_t, and (explicitly) from any integral type. Adopt this for use with the Accessibility bits in a ValueDecl. No intended functionality change. Swift SVN r20597