File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -7048,7 +7048,7 @@ void SwiftDeclConverter::importInheritedConstructors(
7048
7048
7049
7049
auto curObjCClass = cast<clang::ObjCInterfaceDecl>(classDecl->getClangDecl ());
7050
7050
7051
- auto inheritConstructors = [&](ArrayRef <ValueDecl *> members,
7051
+ auto inheritConstructors = [&](TinyPtrVector <ValueDecl *> members,
7052
7052
Optional<CtorInitializerKind> kind) {
7053
7053
const auto &languageVersion =
7054
7054
Impl.SwiftContext .LangOpts .EffectiveLanguageVersion ;
Original file line number Diff line number Diff line change @@ -354,17 +354,15 @@ SILInstruction *CastOptimizer::optimizeBridgedSwiftToObjCCast(
354
354
355
355
auto *NTD = Source.getNominalOrBoundGenericNominal ();
356
356
assert (NTD);
357
- SmallVector<ValueDecl *, 4 > FoundMembers;
358
- ArrayRef<ValueDecl *> Members;
359
- Members = NTD->lookupDirect (M.getASTContext ().Id_bridgeToObjectiveC );
357
+ auto Members = NTD->lookupDirect (M.getASTContext ().Id_bridgeToObjectiveC );
360
358
if (Members.empty ()) {
359
+ SmallVector<ValueDecl *, 4 > FoundMembers;
361
360
if (NTD->getDeclContext ()->lookupQualified (
362
361
NTD, M.getASTContext ().Id_bridgeToObjectiveC ,
363
362
NLOptions::NL_ProtocolMembers, FoundMembers)) {
364
- Members = FoundMembers;
365
363
// Returned members are starting with the most specialized ones.
366
364
// Thus, the first element is what we are looking for.
367
- Members = Members. take_front ( 1 );
365
+ Members. push_back (FoundMembers. front () );
368
366
}
369
367
}
370
368
Original file line number Diff line number Diff line change @@ -7089,7 +7089,7 @@ bool FailureDiagnosis::visitObjectLiteralExpr(ObjectLiteralExpr *E) {
7089
7089
return false ;
7090
7090
DeclName constrName = TC.getObjectLiteralConstructorName (E);
7091
7091
assert (constrName);
7092
- ArrayRef<ValueDecl *> constrs = protocol->lookupDirect (constrName);
7092
+ auto constrs = protocol->lookupDirect (constrName);
7093
7093
if (constrs.size () != 1 || !isa<ConstructorDecl>(constrs.front ()))
7094
7094
return false ;
7095
7095
auto *constr = cast<ConstructorDecl>(constrs.front ());
Original file line number Diff line number Diff line change @@ -1323,7 +1323,7 @@ namespace {
1323
1323
// use the right labels before forming the call to the initializer.
1324
1324
DeclName constrName = tc.getObjectLiteralConstructorName (expr);
1325
1325
assert (constrName);
1326
- ArrayRef<ValueDecl *> constrs = protocol->lookupDirect (constrName);
1326
+ auto constrs = protocol->lookupDirect (constrName);
1327
1327
if (constrs.size () != 1 || !isa<ConstructorDecl>(constrs.front ())) {
1328
1328
tc.diagnose (protocol, diag::object_literal_broken_proto);
1329
1329
return nullptr ;
You can’t perform that action at this time.
0 commit comments