[libclang/codecompletion] Make sure the top-level decl hash takes into account ImportDecls.

The top-level hash is used to determine if we need to update the global code-completion results.
ImportDecls did not affect the hash so a newly introduced ImportDecl would not trigger an update of the global results.

rdar://14202797

llvm-svn: 184782
This commit is contained in:
Argyrios Kyrtzidis 2013-06-24 21:19:12 +00:00
parent bf2d23c0d7
commit 48d88de2af
1 changed files with 9 additions and 1 deletions

View File

@ -884,7 +884,15 @@ void AddTopLevelDeclarationToHash(Decl *D, unsigned &Hash) {
Hash = llvm::HashString(NameStr, Hash);
}
return;
}
}
if (ImportDecl *ImportD = dyn_cast<ImportDecl>(D)) {
if (Module *Mod = ImportD->getImportedModule()) {
std::string ModName = Mod->getFullModuleName();
Hash = llvm::HashString(ModName, Hash);
}
return;
}
}
class TopLevelDeclTrackerConsumer : public ASTConsumer {