[AST] Remove SourceFile::addImports

Temporarily replace with `SourceFile::setImports`
until import resolution is requestified. Now
imports are only set once for a given SourceFile.

Because we're now asserting in more places that
import resolution must have run before querying
imports, this commit also adds
`getCachedUnderlyingType` to TypeAliasDecl to stop
the ASTDumper from trying to query imports for a
-dump-parse invocation.
This commit is contained in:
Hamish Knight
2020-04-14 08:32:02 -07:00
parent b500f371fe
commit 92103a7c63
5 changed files with 25 additions and 25 deletions

View File

@@ -288,7 +288,7 @@ void swift::performImportResolution(SourceFile &SF) {
for (auto D : SF.getTopLevelDecls())
resolver.visit(D);
SF.addImports(resolver.getFinishedImports());
SF.setImports(resolver.getFinishedImports());
SF.ASTStage = SourceFile::ImportsResolved;
verify(SF);