File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed
Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ class FileUnit : public DeclContext {
272272 return dyn_cast_or_null<ClassDecl>(getMainDecl ());
273273 }
274274 bool hasMainDecl () const { return getMainDecl (); }
275- virtual Decl *getMainDecl () const { return nullptr ; }
275+ virtual ValueDecl *getMainDecl () const { return nullptr ; }
276276 FuncDecl *getMainFunc () const {
277277 return dyn_cast_or_null<FuncDecl>(getMainDecl ());
278278 }
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class SourceFile final : public FileUnit {
9999
100100 // / Either the class marked \@NS/UIApplicationMain or the synthesized FuncDecl
101101 // / that calls main on the type marked @main.
102- Decl *MainDecl = nullptr ;
102+ ValueDecl *MainDecl = nullptr ;
103103
104104 // / The source location of the main type.
105105 SourceLoc MainDeclDiagLoc;
@@ -479,7 +479,7 @@ class SourceFile final : public FileUnit {
479479 llvm_unreachable (" bad SourceFileKind" );
480480 }
481481
482- Decl *getMainDecl () const override { return MainDecl; }
482+ ValueDecl *getMainDecl () const override { return MainDecl; }
483483 SourceLoc getMainDeclDiagLoc () const {
484484 assert (hasMainDecl ());
485485 return MainDeclDiagLoc;
@@ -493,7 +493,7 @@ class SourceFile final : public FileUnit {
493493 // / one.
494494 // /
495495 // / Should only be called during type-checking.
496- bool registerMainDecl (Decl *mainDecl, SourceLoc diagLoc);
496+ bool registerMainDecl (ValueDecl *mainDecl, SourceLoc diagLoc);
497497
498498 // / True if this source file has an application entry point.
499499 // /
Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ class SerializedASTFile final : public LoadedFile {
432432
433433 virtual StringRef getModuleDefiningPath () const override ;
434434
435- Decl *getMainDecl () const override ;
435+ ValueDecl *getMainDecl () const override ;
436436
437437 bool hasEntryPoint () const override ;
438438
Original file line number Diff line number Diff line change @@ -1418,7 +1418,7 @@ bool ModuleDecl::isBuiltinModule() const {
14181418 return this == getASTContext ().TheBuiltinModule ;
14191419}
14201420
1421- bool SourceFile::registerMainDecl (Decl *mainDecl, SourceLoc diagLoc) {
1421+ bool SourceFile::registerMainDecl (ValueDecl *mainDecl, SourceLoc diagLoc) {
14221422 assert (mainDecl);
14231423 if (mainDecl == MainDecl)
14241424 return false ;
Original file line number Diff line number Diff line change @@ -1237,9 +1237,9 @@ bool SerializedASTFile::getAllGenericSignatures(
12371237 return true ;
12381238}
12391239
1240- Decl *SerializedASTFile::getMainDecl () const {
1240+ ValueDecl *SerializedASTFile::getMainDecl () const {
12411241 assert (hasEntryPoint ());
1242- return File.getDecl (File.getEntryPointDeclID ());
1242+ return cast_or_null<ValueDecl>( File.getDecl (File.getEntryPointDeclID () ));
12431243}
12441244
12451245const version::Version &SerializedASTFile::getLanguageVersionBuiltWith () const {
You can’t perform that action at this time.
0 commit comments