summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-06-24 21:19:12 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-06-24 21:19:12 +0000
commit48d88de2af81cc6d0c01fc6656c234e1b3655c2b (patch)
tree5e082ead8b9fcd8df4bb392a50f5c219196ae053 /clang/lib
parentbf2d23c0d70bc78110037fae474778ae8ba6a013 (diff)
downloadbcm5719-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')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp10
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 {
OpenPOWER on IntegriCloud