These new Clang attributes identify whether an enum is intended to
represent an option set or not, and whether the set of cases listed in
the enum declaration is exhaustive. (Swift doesn't currently have a
closed/open distinction for enums, so treat any C enum with
enum_extensibility as a proper closed Swift enum, like we do with
NS_ENUM.)
Enums with neither attribute will continue to be imported as unique
types.
rdar://problem/28476618
Or rather, when the name importer decides that the name it /would/
have should start with a number, and gives up. We should probably
fix that separately, but meanwhile don't crash.
> Roses are red
> Prefix-stripping can create an invalid remainder
> assert(!member->NextDecl &&
> "Already added to a container")
rdar://problem/30401506
This shows that the owner of the option set has thought about the
zero case, and wants it to be available in Swift, rather than disabling
it with the default "use [] to construct an empty option set" message.
rdar://problem/26290766
If the common prefix of the enum /elements/ had an underscore in the /middle/,
we previously had cases where we'd end up leaving that underscore in place.
rdar://problem/20800204
Swift SVN r29673
If the common prefix of all enumerators ends with an underscore, but the
enumerators don't have a common prefix with the enum itself, we can't
drop the underscore.
rdar://problem/18730653
Swift SVN r23941
and check for CF_ENUM/CF_OPTIONS, which NS_ENUM/NS_OPTIONS expand to.
This:
- Simplifies code
- Handles CF_ENUM/CF_OPTIONS enums
- Handles correctly an NS_ENUM/NS_OPTIONS enum that was itself expanded from another macro.
Swift SVN r11542