AST printing / getDisplayDecls: correctly form the access path to the module

Removes (harmless) stderr output in tests like:

error: no submodule named 'fooFunc1' in module 'FooClangModule'


Swift SVN r11200
This commit is contained in:
Dmitri Hrybenko
2013-12-12 19:19:14 +00:00
parent 1a3ff1e9b2
commit a768ea8ef3

View File

@@ -620,7 +620,6 @@ void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
auto ScopeID = Ctx.getIdentifier(ScopePath); auto ScopeID = Ctx.getIdentifier(ScopePath);
assert(!ScopeID.empty() && assert(!ScopeID.empty() &&
"invalid decl name (non-top-level decls not supported)"); "invalid decl name (non-top-level decls not supported)");
AccessPath.push_back({ ScopeID, SourceLoc() });
Module *M = Ctx.getModule(AccessPath); Module *M = Ctx.getModule(AccessPath);
if (!M) { if (!M) {
@@ -636,6 +635,8 @@ void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
"deserialized imports should not be ambigous"); "deserialized imports should not be ambigous");
Kind = *FoundKind; Kind = *FoundKind;
} }
AccessPath.push_back({ ScopeID, SourceLoc() });
} }
ImportDecls.push_back(ImportDecl::create( ImportDecls.push_back(ImportDecl::create(