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 {
272
272
return dyn_cast_or_null<ClassDecl>(getMainDecl ());
273
273
}
274
274
bool hasMainDecl () const { return getMainDecl (); }
275
- virtual Decl *getMainDecl () const { return nullptr ; }
275
+ virtual ValueDecl *getMainDecl () const { return nullptr ; }
276
276
FuncDecl *getMainFunc () const {
277
277
return dyn_cast_or_null<FuncDecl>(getMainDecl ());
278
278
}
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class SourceFile final : public FileUnit {
99
99
100
100
// / Either the class marked \@NS/UIApplicationMain or the synthesized FuncDecl
101
101
// / that calls main on the type marked @main.
102
- Decl *MainDecl = nullptr ;
102
+ ValueDecl *MainDecl = nullptr ;
103
103
104
104
// / The source location of the main type.
105
105
SourceLoc MainDeclDiagLoc;
@@ -479,7 +479,7 @@ class SourceFile final : public FileUnit {
479
479
llvm_unreachable (" bad SourceFileKind" );
480
480
}
481
481
482
- Decl *getMainDecl () const override { return MainDecl; }
482
+ ValueDecl *getMainDecl () const override { return MainDecl; }
483
483
SourceLoc getMainDeclDiagLoc () const {
484
484
assert (hasMainDecl ());
485
485
return MainDeclDiagLoc;
@@ -493,7 +493,7 @@ class SourceFile final : public FileUnit {
493
493
// / one.
494
494
// /
495
495
// / Should only be called during type-checking.
496
- bool registerMainDecl (Decl *mainDecl, SourceLoc diagLoc);
496
+ bool registerMainDecl (ValueDecl *mainDecl, SourceLoc diagLoc);
497
497
498
498
// / True if this source file has an application entry point.
499
499
// /
Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ class SerializedASTFile final : public LoadedFile {
432
432
433
433
virtual StringRef getModuleDefiningPath () const override ;
434
434
435
- Decl *getMainDecl () const override ;
435
+ ValueDecl *getMainDecl () const override ;
436
436
437
437
bool hasEntryPoint () const override ;
438
438
Original file line number Diff line number Diff line change @@ -1418,7 +1418,7 @@ bool ModuleDecl::isBuiltinModule() const {
1418
1418
return this == getASTContext ().TheBuiltinModule ;
1419
1419
}
1420
1420
1421
- bool SourceFile::registerMainDecl (Decl *mainDecl, SourceLoc diagLoc) {
1421
+ bool SourceFile::registerMainDecl (ValueDecl *mainDecl, SourceLoc diagLoc) {
1422
1422
assert (mainDecl);
1423
1423
if (mainDecl == MainDecl)
1424
1424
return false ;
Original file line number Diff line number Diff line change @@ -1237,9 +1237,9 @@ bool SerializedASTFile::getAllGenericSignatures(
1237
1237
return true ;
1238
1238
}
1239
1239
1240
- Decl *SerializedASTFile::getMainDecl () const {
1240
+ ValueDecl *SerializedASTFile::getMainDecl () const {
1241
1241
assert (hasEntryPoint ());
1242
- return File.getDecl (File.getEntryPointDeclID ());
1242
+ return cast_or_null<ValueDecl>( File.getDecl (File.getEntryPointDeclID () ));
1243
1243
}
1244
1244
1245
1245
const version::Version &SerializedASTFile::getLanguageVersionBuiltWith () const {
You can’t perform that action at this time.
0 commit comments