@@ -833,7 +833,7 @@ static bool areAllStoredPropertiesDefaultInitializable(NominalTypeDecl *decl) {
833
833
return true ;
834
834
}
835
835
836
- static void addImplicitConstructorsToStruct (StructDecl *decl, ASTContext &ctx ) {
836
+ static void addImplicitConstructorsToStruct (StructDecl *decl) {
837
837
assert (!decl->hasClangNode () &&
838
838
" ClangImporter is responsible for adding implicit constructors" );
839
839
assert (!decl->hasUnreferenceableStorage () &&
@@ -884,6 +884,7 @@ static void addImplicitConstructorsToStruct(StructDecl *decl, ASTContext &ctx) {
884
884
885
885
if (FoundMemberwiseInitializedProperty) {
886
886
// Create the implicit memberwise constructor.
887
+ auto &ctx = decl->getASTContext ();
887
888
auto ctor = createImplicitConstructor (
888
889
decl, ImplicitConstructorKind::Memberwise, ctx);
889
890
decl->addMember (ctor);
@@ -893,7 +894,7 @@ static void addImplicitConstructorsToStruct(StructDecl *decl, ASTContext &ctx) {
893
894
TypeChecker::defineDefaultConstructor (decl);
894
895
}
895
896
896
- static void addImplicitConstructorsToClass (ClassDecl *decl, ASTContext &ctx ) {
897
+ static void addImplicitConstructorsToClass (ClassDecl *decl) {
897
898
// Bail out if we're validating one of our constructors already;
898
899
// we'll revisit the issue later.
899
900
if (!decl->hasClangNode ()) {
@@ -911,6 +912,7 @@ static void addImplicitConstructorsToClass(ClassDecl *decl, ASTContext &ctx) {
911
912
// variable.
912
913
bool FoundDesignatedInit = false ;
913
914
915
+ auto &ctx = decl->getASTContext ();
914
916
SmallVector<std::pair<ValueDecl *, Type>, 4 > declaredInitializers;
915
917
llvm::SmallPtrSet<ConstructorDecl *, 4 > overriddenInits;
916
918
if (decl->hasClangNode ()) {
@@ -1104,9 +1106,9 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
1104
1106
}
1105
1107
1106
1108
if (auto *structDecl = dyn_cast<StructDecl>(decl))
1107
- addImplicitConstructorsToStruct (structDecl, Context );
1109
+ addImplicitConstructorsToStruct (structDecl);
1108
1110
if (auto *classDecl = dyn_cast<ClassDecl>(decl))
1109
- addImplicitConstructorsToClass (classDecl, Context );
1111
+ addImplicitConstructorsToClass (classDecl);
1110
1112
}
1111
1113
1112
1114
void TypeChecker::synthesizeMemberForLookup (NominalTypeDecl *target,
0 commit comments