forked from OSchip/llvm-project
[libclang] For an unscoped enum include the enumerators in the top-level code-completion hash since they enter the top-level namespace.
rdar://14703327 llvm-svn: 192720
This commit is contained in:
parent
daf4831868
commit
ca5c7be088
|
@ -877,6 +877,18 @@ void AddTopLevelDeclarationToHash(Decl *D, unsigned &Hash) {
|
|||
return;
|
||||
|
||||
if (NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
|
||||
if (EnumDecl *EnumD = dyn_cast<EnumDecl>(D)) {
|
||||
// For an unscoped enum include the enumerators in the hash since they
|
||||
// enter the top-level namespace.
|
||||
if (!EnumD->isScoped()) {
|
||||
for (EnumDecl::enumerator_iterator EI = EnumD->enumerator_begin(),
|
||||
EE = EnumD->enumerator_end(); EI != EE; ++EI) {
|
||||
if ((*EI)->getIdentifier())
|
||||
Hash = llvm::HashString((*EI)->getIdentifier()->getName(), Hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ND->getIdentifier())
|
||||
Hash = llvm::HashString(ND->getIdentifier()->getName(), Hash);
|
||||
else if (DeclarationName Name = ND->getDeclName()) {
|
||||
|
|
Loading…
Reference in New Issue