diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-16 23:05:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-16 23:05:20 +0000 |
commit | 59cab5564fc252fd744a57e2ef393a2e35c12754 (patch) | |
tree | 6b01e8e571d5674c8ba22391f1a3a5b443eb9b15 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 6dce6de80ced8e8833be4885cd803c943c1f5c54 (diff) | |
download | bcm5719-llvm-59cab5564fc252fd744a57e2ef393a2e35c12754.tar.gz bcm5719-llvm-59cab5564fc252fd744a57e2ef393a2e35c12754.zip |
Implement support for cached code completions for
nested-name-specifiers. Also includes fixes to the generation of
nested-name-specifier result in the non-cached case; we were producing
lame results for namespaces and namespace aliases, which (1) didn't
always have nested-name-specifiers when we want them, and (2) did not
have the necessary "::" as part of the completion.
llvm-svn: 111203
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 332f8c80293..d61c4301413 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -426,6 +426,12 @@ bool ResultBuilder::isInterestingDecl(NamedDecl *ND, if (isa<CXXConstructorDecl>(ND)) return false; + if (Filter == &ResultBuilder::IsNestedNameSpecifier || + ((isa<NamespaceDecl>(ND) || isa<NamespaceAliasDecl>(ND)) && + Filter != &ResultBuilder::IsNamespace && + Filter != &ResultBuilder::IsNamespaceOrAlias)) + AsNestedNameSpecifier = true; + // Filter out any unwanted results. if (Filter && !(this->*Filter)(ND)) { // Check whether it is interesting as a nested-name-specifier. @@ -439,11 +445,7 @@ bool ResultBuilder::isInterestingDecl(NamedDecl *ND, } return false; - } - - if (Filter == &ResultBuilder::IsNestedNameSpecifier) - AsNestedNameSpecifier = true; - + } // ... then it must be interesting! return true; } |