mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce the ObjCSelector class to store an Objective-C selector.
We have to work with selectors quite often, so provide an efficient representation for them. Switch ObjCAttr over to this representation, which has the nice property that it efficiently represents implicit @objc attributes with names and allows us to overwrite the Objective-C name without losing all source information. Addresses <rdar://problem/16478678>, and sets us up for dealing with selectors better. Swift SVN r16327
This commit is contained in:
@@ -40,7 +40,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// Serialized module format minor version number.
|
||||
///
|
||||
/// When the format changes IN ANY WAY, this number should be incremented.
|
||||
const uint16_t VERSION_MINOR = 56;
|
||||
const uint16_t VERSION_MINOR = 57;
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -200,15 +200,6 @@ enum LibraryKind : uint8_t {
|
||||
};
|
||||
using LibraryKindField = BCFixed<1>;
|
||||
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR.
|
||||
enum ObjCDeclAttrKind : uint8_t {
|
||||
Unnamed,
|
||||
Nullary,
|
||||
Selector,
|
||||
};
|
||||
using ObjCDeclAttrKindField = BCFixed<2>;
|
||||
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR. Adding a new ID requires adding a byte of overhead to the
|
||||
// identifier table in Serializer::writeAllIdentifiers.
|
||||
@@ -982,7 +973,7 @@ namespace decls_block {
|
||||
using ObjCDeclAttrLayout = BCRecordLayout<
|
||||
ObjC_DECL_ATTR,
|
||||
BCFixed<1>, // implicit flag
|
||||
ObjCDeclAttrKindField, // kind
|
||||
BCVBR<4>, // # of arguments (+1) or zero if no name
|
||||
BCArray<IdentifierIDField>
|
||||
>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user