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 @@ -7040,7 +7040,7 @@ void SwiftDeclConverter::importInheritedConstructors(
7040
7040
7041
7041
auto curObjCClass = cast<clang::ObjCInterfaceDecl>(classDecl->getClangDecl ());
7042
7042
7043
- auto inheritConstructors = [&](ArrayRef <ValueDecl *> members,
7043
+ auto inheritConstructors = [&](TinyPtrVector <ValueDecl *> members,
7044
7044
Optional<CtorInitializerKind> kind) {
7045
7045
const auto &languageVersion =
7046
7046
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 @@ -7084,7 +7084,7 @@ bool FailureDiagnosis::visitObjectLiteralExpr(ObjectLiteralExpr *E) {
7084
7084
return false ;
7085
7085
DeclName constrName = TC.getObjectLiteralConstructorName (E);
7086
7086
assert (constrName);
7087
- ArrayRef<ValueDecl *> constrs = protocol->lookupDirect (constrName);
7087
+ auto constrs = protocol->lookupDirect (constrName);
7088
7088
if (constrs.size () != 1 || !isa<ConstructorDecl>(constrs.front ()))
7089
7089
return false ;
7090
7090
auto *constr = cast<ConstructorDecl>(constrs.front ());
Original file line number Diff line number Diff line change @@ -1306,7 +1306,7 @@ namespace {
1306
1306
// use the right labels before forming the call to the initializer.
1307
1307
DeclName constrName = tc.getObjectLiteralConstructorName (expr);
1308
1308
assert (constrName);
1309
- ArrayRef<ValueDecl *> constrs = protocol->lookupDirect (constrName);
1309
+ auto constrs = protocol->lookupDirect (constrName);
1310
1310
if (constrs.size () != 1 || !isa<ConstructorDecl>(constrs.front ())) {
1311
1311
tc.diagnose (protocol, diag::object_literal_broken_proto);
1312
1312
return nullptr ;
You can’t perform that action at this time.
0 commit comments