diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-06-24 21:19:12 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-06-24 21:19:12 +0000 |
commit | 48d88de2af81cc6d0c01fc6656c234e1b3655c2b (patch) | |
tree | 5e082ead8b9fcd8df4bb392a50f5c219196ae053 /clang/lib/Frontend/ASTUnit.cpp | |
parent | bf2d23c0d70bc78110037fae474778ae8ba6a013 (diff) | |
download | bcm5719-llvm-48d88de2af81cc6d0c01fc6656c234e1b3655c2b.tar.gz bcm5719-llvm-48d88de2af81cc6d0c01fc6656c234e1b3655c2b.zip |
[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
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 48cac1357c7..364d8f30405 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -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 { |