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 @@ -273,7 +273,7 @@ class FileUnit : public DeclContext {
273
273
return dyn_cast_or_null<ClassDecl>(getMainDecl ());
274
274
}
275
275
bool hasMainDecl () const { return getMainDecl (); }
276
- virtual Decl *getMainDecl () const { return nullptr ; }
276
+ virtual ValueDecl *getMainDecl () const { return nullptr ; }
277
277
FuncDecl *getMainFunc () const {
278
278
return dyn_cast_or_null<FuncDecl>(getMainDecl ());
279
279
}
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;
@@ -488,7 +488,7 @@ class SourceFile final : public FileUnit {
488
488
llvm_unreachable (" bad SourceFileKind" );
489
489
}
490
490
491
- Decl *getMainDecl () const override { return MainDecl; }
491
+ ValueDecl *getMainDecl () const override { return MainDecl; }
492
492
SourceLoc getMainDeclDiagLoc () const {
493
493
assert (hasMainDecl ());
494
494
return MainDeclDiagLoc;
@@ -502,7 +502,7 @@ class SourceFile final : public FileUnit {
502
502
// / one.
503
503
// /
504
504
// / Should only be called during type-checking.
505
- bool registerMainDecl (Decl *mainDecl, SourceLoc diagLoc);
505
+ bool registerMainDecl (ValueDecl *mainDecl, SourceLoc diagLoc);
506
506
507
507
// / True if this source file has an application entry point.
508
508
// /
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ class SerializedASTFile final : public LoadedFile {
433
433
434
434
virtual StringRef getModuleDefiningPath () const override ;
435
435
436
- Decl *getMainDecl () const override ;
436
+ ValueDecl *getMainDecl () const override ;
437
437
438
438
bool hasEntryPoint () const override ;
439
439
Original file line number Diff line number Diff line change @@ -1587,7 +1587,7 @@ bool ModuleDecl::isBuiltinModule() const {
1587
1587
return this == getASTContext ().TheBuiltinModule ;
1588
1588
}
1589
1589
1590
- bool SourceFile::registerMainDecl (Decl *mainDecl, SourceLoc diagLoc) {
1590
+ bool SourceFile::registerMainDecl (ValueDecl *mainDecl, SourceLoc diagLoc) {
1591
1591
assert (mainDecl);
1592
1592
if (mainDecl == MainDecl)
1593
1593
return false ;
Original file line number Diff line number Diff line change @@ -1262,9 +1262,9 @@ bool SerializedASTFile::getAllGenericSignatures(
1262
1262
return true ;
1263
1263
}
1264
1264
1265
- Decl *SerializedASTFile::getMainDecl () const {
1265
+ ValueDecl *SerializedASTFile::getMainDecl () const {
1266
1266
assert (hasEntryPoint ());
1267
- return File.getDecl (File.getEntryPointDeclID ());
1267
+ return cast_or_null<ValueDecl>( File.getDecl (File.getEntryPointDeclID () ));
1268
1268
}
1269
1269
1270
1270
const version::Version &SerializedASTFile::getLanguageVersionBuiltWith () const {
You can’t perform that action at this time.
0 commit comments