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:
@@ -340,6 +340,20 @@ void SerializedModuleLoader::loadExtensions(NominalTypeDecl *nominal,
|
||||
}
|
||||
}
|
||||
|
||||
void SerializedModuleLoader::loadObjCMethods(
|
||||
ClassDecl *classDecl,
|
||||
ObjCSelector selector,
|
||||
bool isInstanceMethod,
|
||||
unsigned previousGeneration,
|
||||
llvm::TinyPtrVector<AbstractFunctionDecl *> &methods) {
|
||||
for (auto &modulePair : LoadedModuleFiles) {
|
||||
if (modulePair.second <= previousGeneration)
|
||||
continue;
|
||||
modulePair.first->loadObjCMethods(classDecl, selector, isInstanceMethod,
|
||||
methods);
|
||||
}
|
||||
}
|
||||
|
||||
bool SerializedModuleLoader::isSerializedAST(StringRef data) {
|
||||
using serialization::MODULE_SIGNATURE;
|
||||
StringRef signatureStr(reinterpret_cast<const char *>(MODULE_SIGNATURE),
|
||||
|
||||
Reference in New Issue
Block a user