forked from OSchip/llvm-project
[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:
parent
bf2d23c0d7
commit
48d88de2af
|
@ -884,7 +884,15 @@ void AddTopLevelDeclarationToHash(Decl *D, unsigned &Hash) {
|
||||||
Hash = llvm::HashString(NameStr, Hash);
|
Hash = llvm::HashString(NameStr, Hash);
|
||||||
}
|
}
|
||||||
return;
|
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 {
|
class TopLevelDeclTrackerConsumer : public ASTConsumer {
|
||||||
|
|
Loading…
Reference in New Issue