AST: Call setValidationStarted() on synthesized declarations

This avoids doing unnecessary work in validateDecl().
This commit is contained in:
Slava Pestov
2017-10-20 23:06:37 -07:00
parent d23e2bce62
commit 15fa6c8955
3 changed files with 9 additions and 0 deletions

View File

@@ -352,6 +352,10 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx)
ctx.addDestructorCleanup(*this);
setImplicit();
setInterfaceType(ModuleType::get(this));
// validateDecl() should return immediately given a ModuleDecl.
setValidationStarted();
setAccess(AccessLevel::Public);
}