mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Do 'bindExtensions()' as a part of 'performParseAndNameBindingOnly()'
This commit is contained in:
@@ -843,18 +843,13 @@ void CompilerInstance::parseAndCheckTypesUpTo(
|
||||
}) && "some files have not yet had their imports resolved");
|
||||
MainModule->setHasResolvedImports();
|
||||
|
||||
// If the limiting AST stage is name binding, we're done.
|
||||
if (limitStage <= SourceFile::NameBound) {
|
||||
if (Invocation.isCodeCompletion()) {
|
||||
performCodeCompletionSecondPass(*PersistentState.get(),
|
||||
*Invocation.getCodeCompletionFactory());
|
||||
}
|
||||
return;
|
||||
}
|
||||
assert(!Invocation.isCodeCompletion());
|
||||
|
||||
const auto &options = Invocation.getFrontendOptions();
|
||||
forEachFileToTypeCheck([&](SourceFile &SF) {
|
||||
if (limitStage == SourceFile::NameBound) {
|
||||
bindExtensions(SF);
|
||||
return;
|
||||
}
|
||||
|
||||
performTypeChecking(SF, PersistentState->getTopLevelContext(),
|
||||
TypeCheckOptions, /*curElem*/ 0,
|
||||
options.WarnLongFunctionBodies,
|
||||
@@ -875,6 +870,17 @@ void CompilerInstance::parseAndCheckTypesUpTo(
|
||||
}
|
||||
});
|
||||
|
||||
if (Invocation.isCodeCompletion()) {
|
||||
assert(limitStage == SourceFile::NameBound);
|
||||
performCodeCompletionSecondPass(*PersistentState.get(),
|
||||
*Invocation.getCodeCompletionFactory());
|
||||
}
|
||||
|
||||
// If the limiting AST stage is name binding, we're done.
|
||||
if (limitStage <= SourceFile::NameBound) {
|
||||
return;
|
||||
}
|
||||
|
||||
finishTypeChecking(TypeCheckOptions);
|
||||
}
|
||||
|
||||
@@ -986,6 +992,7 @@ void CompilerInstance::parseAndTypeCheckMainFileUpTo(
|
||||
llvm_unreachable("invalid limit stage");
|
||||
case SourceFile::NameBound:
|
||||
performNameBinding(MainFile, CurTUElem);
|
||||
bindExtensions(MainFile);
|
||||
break;
|
||||
case SourceFile::TypeChecked:
|
||||
const auto &options = Invocation.getFrontendOptions();
|
||||
|
||||
Reference in New Issue
Block a user