diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-27 22:43:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-27 22:43:10 +0000 |
commit | deafd0b2a42b16568f416fbe218db82d56e2d89d (patch) | |
tree | 95d9f29e2f42e149a9aa1275d62d2b829da42c7f /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 45146a12cf0f3c0ebacc83ef936650c69e3303c8 (diff) | |
download | bcm5719-llvm-deafd0b2a42b16568f416fbe218db82d56e2d89d.tar.gz bcm5719-llvm-deafd0b2a42b16568f416fbe218db82d56e2d89d.zip |
Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.
llvm-svn: 147299
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 79985e8b322..72cc37ccdd3 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/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); - } } } |