Commits

Doug Gregor committed 03b1689b604
Import C enumerations into usable struct types in Swift. Import C enumeration types as either structs wrapping the underlying integral type (when the C enumeration type has a name) or as the underlying integral type (when the C enumeration type has no name). The structs have a constructor from the underlying integral type, so one can write, e.g., NSStringCompareOptions(0) to get a zero-valued enumeration. Enumerators are imported as a global read-only properties. Once oneofs start to work, we'll have a way to map some enumeration types to oneofs, either via a Clang attribute or by sniffing out NS_ENUM (most likely both). Once we have static data members of structs working, we'll replace the global constants with prefix-stripped static variables within the struct, so we can use ".foo" notation with them. Once we have constant declarations, we'll map to those instead of properties. We can add |, &, and ~ operations are part of <rdar://problem/13028799> and have not yet been implemented. Fixes <rdar://problem/13028891>. Swift SVN r3945