@@ -794,32 +794,6 @@ void CompilerInstance::performSemaUpTo(SourceFile::ASTStage_t LimitStage) {
794
794
MainBufferID);
795
795
}
796
796
797
- parseAndCheckTypesUpTo (LimitStage);
798
- }
799
-
800
- bool CompilerInstance::loadStdlib () {
801
- FrontendStatsTracer tracer (getStatsReporter (), " load-stdlib" );
802
- ModuleDecl *M = Context->getStdlibModule (true );
803
-
804
- if (!M) {
805
- Diagnostics.diagnose (SourceLoc (), diag::error_stdlib_not_found,
806
- Invocation.getTargetTriple ());
807
- return false ;
808
- }
809
-
810
- // If we failed to load, we should have already diagnosed
811
- if (M->failedToLoad ()) {
812
- assert (Diagnostics.hadAnyError () &&
813
- " Module failed to load but nothing was diagnosed?" );
814
- return false ;
815
- }
816
- return true ;
817
- }
818
-
819
- void CompilerInstance::parseAndCheckTypesUpTo (
820
- SourceFile::ASTStage_t limitStage) {
821
- FrontendStatsTracer tracer (getStatsReporter (), " parse-and-check-types" );
822
-
823
797
bool hadLoadError = parsePartialModulesAndInputFiles ();
824
798
if (hadLoadError)
825
799
return ;
@@ -833,7 +807,7 @@ void CompilerInstance::parseAndCheckTypesUpTo(
833
807
MainModule->setHasResolvedImports ();
834
808
835
809
forEachFileToTypeCheck ([&](SourceFile &SF) {
836
- if (limitStage == SourceFile::ImportsResolved) {
810
+ if (LimitStage == SourceFile::ImportsResolved) {
837
811
bindExtensions (SF);
838
812
return ;
839
813
}
@@ -849,13 +823,32 @@ void CompilerInstance::parseAndCheckTypesUpTo(
849
823
});
850
824
851
825
// If the limiting AST stage is import resolution, we're done.
852
- if (limitStage <= SourceFile::ImportsResolved) {
826
+ if (LimitStage <= SourceFile::ImportsResolved) {
853
827
return ;
854
828
}
855
829
856
830
finishTypeChecking ();
857
831
}
858
832
833
+ bool CompilerInstance::loadStdlib () {
834
+ FrontendStatsTracer tracer (getStatsReporter (), " load-stdlib" );
835
+ ModuleDecl *M = Context->getStdlibModule (true );
836
+
837
+ if (!M) {
838
+ Diagnostics.diagnose (SourceLoc (), diag::error_stdlib_not_found,
839
+ Invocation.getTargetTriple ());
840
+ return false ;
841
+ }
842
+
843
+ // If we failed to load, we should have already diagnosed
844
+ if (M->failedToLoad ()) {
845
+ assert (Diagnostics.hadAnyError () &&
846
+ " Module failed to load but nothing was diagnosed?" );
847
+ return false ;
848
+ }
849
+ return true ;
850
+ }
851
+
859
852
bool CompilerInstance::parsePartialModulesAndInputFiles () {
860
853
FrontendStatsTracer tracer (getStatsReporter (),
861
854
" parse-partial-modules-and-input-files" );
0 commit comments