[modules] Don't eagerly deserialize so many ImportDecls. CodeGen basically ignores ImportDecls imported from modules, so only eagerly deserialize the ones from a PCH / preamble.

llvm-svn: 245406
This commit is contained in:
Richard Smith
2015-08-19 02:30:28 +00:00
parent 72be1c1b64
commit c52efa7d40
2 changed files with 13 additions and 11 deletions

View File

@@ -3363,11 +3363,8 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
auto *Import = cast<ImportDecl>(D);
// Ignore import declarations that come from imported modules.
if (clang::Module *Owner = Import->getImportedOwningModule()) {
if (getLangOpts().CurrentModule.empty() ||
Owner->getTopLevelModule()->Name == getLangOpts().CurrentModule)
break;
}
if (Import->getImportedOwningModule())
break;
if (CGDebugInfo *DI = getModuleDebugInfo())
DI->EmitImportDecl(*Import);