[NFC] Serialize ObjC selectors for protocols

The ObjCMethodLookupTable for protocols was not being serialized and rebuilt on load, so NominalTypeDecl::lookupDirect() on selectors was not working correctly for deserialized types. Correct this oversight.
This commit is contained in:
Becca Royal-Gordon
2022-06-16 14:07:49 -07:00
parent dc4162fddb
commit 9b5f89963b
12 changed files with 40 additions and 30 deletions

View File

@@ -5539,10 +5539,10 @@ static void collectInterestingNestedDeclarations(
if (isLocal)
return;
if (auto owningClass = func->getDeclContext()->getSelfClassDecl()) {
if (auto owningType = func->getDeclContext()->getSelfNominalTypeDecl()) {
if (func->isObjC()) {
Mangle::ASTMangler mangler;
std::string ownerName = mangler.mangleNominalType(owningClass);
std::string ownerName = mangler.mangleNominalType(owningType);
assert(!ownerName.empty() && "Mangled type came back empty!");
objcMethods[func->getObjCSelector()].push_back(