@@ -323,15 +323,13 @@ static void typeCheckFunctionsAndExternalDecls(SourceFile &SF, TypeChecker &TC)
323
323
TC.definedFunctions .clear ();
324
324
}
325
325
326
- void swift::performTypeChecking (SourceFile &SF, unsigned StartElem ) {
326
+ void swift::performTypeChecking (SourceFile &SF) {
327
327
return (void )evaluateOrDefault (SF.getASTContext ().evaluator ,
328
- TypeCheckSourceFileRequest{&SF, StartElem},
329
- false );
328
+ TypeCheckSourceFileRequest{&SF}, false );
330
329
}
331
330
332
331
llvm::Expected<bool >
333
- TypeCheckSourceFileRequest::evaluate (Evaluator &eval,
334
- SourceFile *SF, unsigned StartElem) const {
332
+ TypeCheckSourceFileRequest::evaluate (Evaluator &eval, SourceFile *SF) const {
335
333
assert (SF && " Source file cannot be null!" );
336
334
assert (SF->ASTStage != SourceFile::TypeChecked &&
337
335
" Should not be re-typechecking this file!" );
@@ -352,7 +350,7 @@ TypeCheckSourceFileRequest::evaluate(Evaluator &eval,
352
350
353
351
// Make sure that name binding has been completed before doing any type
354
352
// checking.
355
- performNameBinding (*SF, StartElem );
353
+ performNameBinding (*SF);
356
354
357
355
// Could build scope maps here because the AST is stable now.
358
356
@@ -369,7 +367,7 @@ TypeCheckSourceFileRequest::evaluate(Evaluator &eval,
369
367
if (!Ctx.LangOpts .DisableAvailabilityChecking ) {
370
368
// Build the type refinement hierarchy for the primary
371
369
// file before type checking.
372
- TypeChecker::buildTypeRefinementContextHierarchy (*SF, StartElem );
370
+ TypeChecker::buildTypeRefinementContextHierarchy (*SF);
373
371
}
374
372
375
373
// Resolve extensions. This has to occur first during type checking,
@@ -378,7 +376,7 @@ TypeCheckSourceFileRequest::evaluate(Evaluator &eval,
378
376
::bindExtensions (*SF);
379
377
380
378
// Type check the top-level elements of the source file.
381
- for (auto D : SF->getTopLevelDecls (). slice (StartElem) ) {
379
+ for (auto D : SF->getTopLevelDecls ()) {
382
380
if (auto *TLCD = dyn_cast<TopLevelCodeDecl>(D)) {
383
381
// Immediately perform global name-binding etc.
384
382
TypeChecker::typeCheckTopLevelCodeDecl (TLCD);
@@ -391,7 +389,7 @@ TypeCheckSourceFileRequest::evaluate(Evaluator &eval,
391
389
// If we're in REPL mode, inject temporary result variables and other stuff
392
390
// that the REPL needs to synthesize.
393
391
if (SF->Kind == SourceFileKind::REPL && !Ctx.hadError ())
394
- TypeChecker::processREPLTopLevel (*SF, StartElem );
392
+ TypeChecker::processREPLTopLevel (*SF);
395
393
396
394
typeCheckFunctionsAndExternalDecls (*SF, TC);
397
395
}
0 commit comments