mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Record Objective-C method lookup tables in Swift modules.
Include a mapping from Objective-C selectors to the @objc methods that
produce Objective-c methods with those selectors. Use this to lazily
populate the Objective-C method lookup tables in each class. This makes
@objc override checking work across Swift modules, which is part of
rdar://problem/18391046.
Note that we use a single, unified selector table, both because it is
simpler and because it makes global queries ("is there any method with
the given selector?") easier.
Swift SVN r23214
This commit is contained in:
@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// To ensure that two separate changes don't silently get merged into one
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// describe what change you made.
|
||||
const uint16_t VERSION_MINOR = 158; // Last change: objc decl attribute
|
||||
const uint16_t VERSION_MINOR = 159; // Last change: objc method3 table
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -328,7 +328,7 @@ enum BlockID {
|
||||
/// The comment block, which contains documentation comments.
|
||||
///
|
||||
/// \sa comment_block
|
||||
COMMENT_BLOCK_ID,
|
||||
COMMENT_BLOCK_ID
|
||||
};
|
||||
|
||||
/// The record types within the control block.
|
||||
@@ -1210,7 +1210,12 @@ namespace index_block {
|
||||
OPERATORS,
|
||||
EXTENSIONS,
|
||||
CLASS_MEMBERS,
|
||||
OPERATOR_METHODS
|
||||
OPERATOR_METHODS,
|
||||
|
||||
/// The Objective-C method index, which contains a mapping from
|
||||
/// Objective-C selectors to the methods/initializers/properties/etc. that
|
||||
/// produce Objective-C methods.
|
||||
OBJC_METHODS,
|
||||
};
|
||||
|
||||
using OffsetsLayout = BCGenericRecordLayout<
|
||||
@@ -1223,6 +1228,12 @@ namespace index_block {
|
||||
BCVBR<16>, // table offset within the blob (see below)
|
||||
BCBlob // map from identifier strings to decl kinds / decl IDs
|
||||
>;
|
||||
|
||||
using ObjCMethodTableLayout = BCRecordLayout<
|
||||
OBJC_METHODS, // record ID
|
||||
BCVBR<16>, // table offset within the blob (see below)
|
||||
BCBlob // map from Objective-C selectors to methods with that selector
|
||||
>;
|
||||
}
|
||||
|
||||
/// \sa COMMENT_BLOCK_ID
|
||||
|
||||
Reference in New Issue
Block a user