[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

@@ -631,7 +631,7 @@ namespace {
void visitTypeAliasDecl(TypeAliasDecl *TAD) {
printCommon(TAD, "typealias");
PrintWithColorRAII(OS, TypeColor) << " type='";
if (auto underlying = TAD->getUnderlyingType()) {
if (auto underlying = TAD->getCachedUnderlyingType()) {
PrintWithColorRAII(OS, TypeColor)
<< underlying.getString();
} else {