summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-16 23:05:20 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-16 23:05:20 +0000
commit59cab5564fc252fd744a57e2ef393a2e35c12754 (patch)
tree6b01e8e571d5674c8ba22391f1a3a5b443eb9b15 /clang/lib/Sema/SemaCodeComplete.cpp
parent6dce6de80ced8e8833be4885cd803c943c1f5c54 (diff)
downloadbcm5719-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.cpp12
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;
}
OpenPOWER on IntegriCloud