mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Call setValidationStarted() on synthesized declarations
This avoids doing unnecessary work in validateDecl().
This commit is contained in:
@@ -163,6 +163,7 @@ getBuiltinFunction(Identifier Id, ArrayRef<Type> argTypes, Type ResType,
|
|||||||
Identifier(), argType,
|
Identifier(), argType,
|
||||||
DC);
|
DC);
|
||||||
PD->setInterfaceType(argType);
|
PD->setInterfaceType(argType);
|
||||||
|
PD->setValidationStarted();
|
||||||
PD->setImplicit();
|
PD->setImplicit();
|
||||||
params.push_back(PD);
|
params.push_back(PD);
|
||||||
}
|
}
|
||||||
@@ -180,6 +181,7 @@ getBuiltinFunction(Identifier Id, ArrayRef<Type> argTypes, Type ResType,
|
|||||||
paramList,
|
paramList,
|
||||||
TypeLoc::withoutLoc(ResType), DC);
|
TypeLoc::withoutLoc(ResType), DC);
|
||||||
FD->setInterfaceType(FnType);
|
FD->setInterfaceType(FnType);
|
||||||
|
FD->setValidationStarted();
|
||||||
FD->setImplicit();
|
FD->setImplicit();
|
||||||
FD->setAccess(AccessLevel::Public);
|
FD->setAccess(AccessLevel::Public);
|
||||||
return FD;
|
return FD;
|
||||||
@@ -226,6 +228,7 @@ getBuiltinGenericFunction(Identifier Id,
|
|||||||
Identifier(),
|
Identifier(),
|
||||||
paramType->getInOutObjectType(), DC);
|
paramType->getInOutObjectType(), DC);
|
||||||
PD->setInterfaceType(paramIfaceType->getInOutObjectType());
|
PD->setInterfaceType(paramIfaceType->getInOutObjectType());
|
||||||
|
PD->setValidationStarted();
|
||||||
PD->setImplicit();
|
PD->setImplicit();
|
||||||
params.push_back(PD);
|
params.push_back(PD);
|
||||||
}
|
}
|
||||||
@@ -244,6 +247,7 @@ getBuiltinGenericFunction(Identifier Id,
|
|||||||
TypeLoc::withoutLoc(ResBodyType), DC);
|
TypeLoc::withoutLoc(ResBodyType), DC);
|
||||||
|
|
||||||
func->setInterfaceType(InterfaceType);
|
func->setInterfaceType(InterfaceType);
|
||||||
|
func->setValidationStarted();
|
||||||
func->setGenericEnvironment(Env);
|
func->setGenericEnvironment(Env);
|
||||||
func->setImplicit();
|
func->setImplicit();
|
||||||
func->setAccess(AccessLevel::Public);
|
func->setAccess(AccessLevel::Public);
|
||||||
|
|||||||
@@ -4315,6 +4315,7 @@ ParamDecl *ParamDecl::createSelf(SourceLoc loc, DeclContext *DC,
|
|||||||
Identifier(), loc, C.Id_self, selfType,DC);
|
Identifier(), loc, C.Id_self, selfType,DC);
|
||||||
selfDecl->setImplicit();
|
selfDecl->setImplicit();
|
||||||
selfDecl->setInterfaceType(selfInterfaceType);
|
selfDecl->setInterfaceType(selfInterfaceType);
|
||||||
|
selfDecl->setValidationStarted();
|
||||||
return selfDecl;
|
return selfDecl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -352,6 +352,10 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx)
|
|||||||
ctx.addDestructorCleanup(*this);
|
ctx.addDestructorCleanup(*this);
|
||||||
setImplicit();
|
setImplicit();
|
||||||
setInterfaceType(ModuleType::get(this));
|
setInterfaceType(ModuleType::get(this));
|
||||||
|
|
||||||
|
// validateDecl() should return immediately given a ModuleDecl.
|
||||||
|
setValidationStarted();
|
||||||
|
|
||||||
setAccess(AccessLevel::Public);
|
setAccess(AccessLevel::Public);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user