aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/CodeCompleteConsumer.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-31 04:52:16 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-31 04:52:16 +0000
commit0a0e2b3631a1c95c280f20d839e82eb9a7647b09 (patch)
tree01dbf12bc11decb59fd1e5bd941d0ceca6159457 /clang/lib/Sema/CodeCompleteConsumer.cpp
parent8c6eeb9599456a8ed12e8ce280e12b1e52abe031 (diff)
downloadllvm-0a0e2b3631a1c95c280f20d839e82eb9a7647b09.zip
llvm-0a0e2b3631a1c95c280f20d839e82eb9a7647b09.tar.gz
llvm-0a0e2b3631a1c95c280f20d839e82eb9a7647b09.tar.bz2
Allow the computation of the base priority for a declaration code completion result to consider the completion context
llvm-svn: 174037
Diffstat (limited to 'clang/lib/Sema/CodeCompleteConsumer.cpp')
-rw-r--r--clang/lib/Sema/CodeCompleteConsumer.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp
index 7877534..19be1cb 100644
--- a/clang/lib/Sema/CodeCompleteConsumer.cpp
+++ b/clang/lib/Sema/CodeCompleteConsumer.cpp
@@ -396,34 +396,6 @@ void CodeCompletionBuilder::addBriefComment(StringRef Comment) {
BriefComment = Allocator.CopyString(Comment);
}
-unsigned CodeCompletionResult::getPriorityFromDecl(const NamedDecl *ND) {
- if (!ND)
- return CCP_Unlikely;
-
- // Context-based decisions.
- const DeclContext *DC = ND->getDeclContext()->getRedeclContext();
- if (DC->isFunctionOrMethod() || isa<BlockDecl>(DC)) {
- // _cmd is relatively rare
- if (const ImplicitParamDecl *ImplicitParam =
- dyn_cast<ImplicitParamDecl>(ND))
- if (ImplicitParam->getIdentifier() &&
- ImplicitParam->getIdentifier()->isStr("_cmd"))
- return CCP_ObjC_cmd;
-
- return CCP_LocalDeclaration;
- }
- if (DC->isRecord() || isa<ObjCContainerDecl>(DC))
- return CCP_MemberDeclaration;
-
- // Content-based decisions.
- if (isa<EnumConstantDecl>(ND))
- return CCP_Constant;
- if (isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND))
- return CCP_Type;
-
- return CCP_Declaration;
-}
-
//===----------------------------------------------------------------------===//
// Code completion overload candidate implementation
//===----------------------------------------------------------------------===//