aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-27 22:43:10 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-27 22:43:10 +0000
commit375bb1413c041055262c8a416f20d10474a5eda9 (patch)
tree66e5d219fe54a005bd13828eaab0234e08ca13fc /lib/Sema/SemaCodeComplete.cpp
parentfedb6ecbed93c6bf12a02d61b2421d6f0da3b4fc (diff)
Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an Objective-C class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 79985e8b32..72cc37ccdd 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -2781,14 +2781,20 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) {
return CXCursor_FunctionDecl;
case Decl::ObjCCategory: return CXCursor_ObjCCategoryDecl;
case Decl::ObjCCategoryImpl: return CXCursor_ObjCCategoryImplDecl;
- case Decl::ObjCClass:
// FIXME
return CXCursor_UnexposedDecl;
case Decl::ObjCForwardProtocol:
// FIXME
return CXCursor_UnexposedDecl;
case Decl::ObjCImplementation: return CXCursor_ObjCImplementationDecl;
- case Decl::ObjCInterface: return CXCursor_ObjCInterfaceDecl;
+
+ case Decl::ObjCInterface:
+ if (cast<ObjCInterfaceDecl>(D)->isThisDeclarationADefinition())
+ return CXCursor_ObjCInterfaceDecl;
+
+ // Forward declarations are not directly exposed.
+ return CXCursor_UnexposedDecl;
+
case Decl::ObjCIvar: return CXCursor_ObjCIvarDecl;
case Decl::ObjCMethod:
return cast<ObjCMethodDecl>(D)->isInstanceMethod()
@@ -5490,15 +5496,6 @@ static void AddInterfaceResults(DeclContext *Ctx, DeclContext *CurContext,
if ((!OnlyForwardDeclarations || !Class->hasDefinition()) &&
(!OnlyUnimplemented || !Class->getImplementation()))
Results.AddResult(Result(Class, 0), CurContext, 0, false);
-
- // Record any forward-declared interfaces we find.
- if (ObjCClassDecl *Forward = dyn_cast<ObjCClassDecl>(*D)) {
- ObjCInterfaceDecl *IDecl = Forward->getForwardInterfaceDecl();
- if ((!OnlyForwardDeclarations || !IDecl->hasDefinition()) &&
- (!OnlyUnimplemented || !IDecl->getImplementation()))
- Results.AddResult(Result(IDecl, 0), CurContext,
- 0, false);
- }
}
}