summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-18 23:30:37 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-18 23:30:37 +0000
commit3a69eafa8845e1f440cff77ecabd3daf1588adb5 (patch)
tree528857142c7f79dae7113eb46a2390dca2759456 /clang/lib/Frontend/ASTUnit.cpp
parent2d6390d47bdab125efce0e382e483e8eb74bf321 (diff)
downloadbcm5719-llvm-3a69eafa8845e1f440cff77ecabd3daf1588adb5.tar.gz
bcm5719-llvm-3a69eafa8845e1f440cff77ecabd3daf1588adb5.zip
When code-completing a case statement for a switch on a value of
enumeration type, prioritize the enumeration constants and don't provide completions for any other expressions. Fixes <rdar://problem/7283668>. llvm-svn: 125991
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 46f5b5a48e7..4a5a51d9f1d 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -333,8 +333,8 @@ void ASTUnit::CacheCodeCompletionResults() {
| (1 << (CodeCompletionContext::CCC_ObjCMessageReceiver - 1))
| (1 << (CodeCompletionContext::CCC_MacroNameUse - 1))
| (1 << (CodeCompletionContext::CCC_PreprocessorExpression - 1))
- | (1 << (CodeCompletionContext::CCC_ParenthesizedExpression - 1));
-
+ | (1 << (CodeCompletionContext::CCC_ParenthesizedExpression - 1))
+ | (1 << (CodeCompletionContext::CCC_OtherWithMacros - 1));
CachedResult.Priority = Results[I].Priority;
CachedResult.Kind = Results[I].CursorKind;
@@ -1790,6 +1790,7 @@ static void CalculateHiddenNames(const CodeCompletionContext &Context,
case CodeCompletionContext::CCC_SelectorName:
case CodeCompletionContext::CCC_TypeQualifiers:
case CodeCompletionContext::CCC_Other:
+ case CodeCompletionContext::CCC_OtherWithMacros:
// We're looking for nothing, or we're looking for names that cannot
// be hidden.
return;
OpenPOWER on IntegriCloud