mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Don't skip import resolution for empty file
The associated comment appears to outdated. Make sure we continue to record implicit imports for empty files.
This commit is contained in:
@@ -276,17 +276,12 @@ private:
|
||||
///
|
||||
/// Import resolution operates on a parsed but otherwise unvalidated AST.
|
||||
void swift::performImportResolution(SourceFile &SF) {
|
||||
// If we've already performed import resolution, bail.
|
||||
if (SF.ASTStage == SourceFile::ImportsResolved)
|
||||
return;
|
||||
|
||||
FrontendStatsTracer tracer(SF.getASTContext().Stats,
|
||||
"Import resolution");
|
||||
|
||||
// Make sure we skip adding the standard library imports if the
|
||||
// source file is empty.
|
||||
if (SF.ASTStage == SourceFile::ImportsResolved ||
|
||||
SF.getTopLevelDecls().empty()) {
|
||||
SF.ASTStage = SourceFile::ImportsResolved;
|
||||
return;
|
||||
}
|
||||
|
||||
ImportResolver resolver(SF);
|
||||
|
||||
// Resolve each import declaration.
|
||||
|
||||
Reference in New Issue
Block a user