diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-01 21:23:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-01 21:23:57 +0000 |
commit | f61026758145df2f845f9c28e89f53c084d35cb2 (patch) | |
tree | 24699428a99f060286b52844b9d54089e363da38 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | c51118238c9a05a3113ce0057bb10169b583a6c5 (diff) | |
download | bcm5719-llvm-f61026758145df2f845f9c28e89f53c084d35cb2.tar.gz bcm5719-llvm-f61026758145df2f845f9c28e89f53c084d35cb2.zip |
Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.
llvm-svn: 147415
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 6843ca7e6cb..78e3c355d62 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -2783,9 +2783,6 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) { case Decl::ObjCCategoryImpl: return CXCursor_ObjCCategoryImplDecl; // FIXME return CXCursor_UnexposedDecl; - case Decl::ObjCForwardProtocol: - // FIXME - return CXCursor_UnexposedDecl; case Decl::ObjCImplementation: return CXCursor_ObjCImplementationDecl; case Decl::ObjCInterface: @@ -2804,7 +2801,12 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) { case Decl::CXXDestructor: return CXCursor_Destructor; case Decl::CXXConversion: return CXCursor_ConversionFunction; case Decl::ObjCProperty: return CXCursor_ObjCPropertyDecl; - case Decl::ObjCProtocol: return CXCursor_ObjCProtocolDecl; + case Decl::ObjCProtocol: + if (cast<ObjCProtocolDecl>(D)->isThisDeclarationADefinition()) + return CXCursor_ObjCProtocolDecl; + + return CXCursor_UnexposedDecl; + case Decl::ParmVar: return CXCursor_ParmDecl; case Decl::Typedef: return CXCursor_TypedefDecl; case Decl::TypeAlias: return CXCursor_TypeAliasDecl; @@ -5422,17 +5424,6 @@ static void AddProtocolResults(DeclContext *Ctx, DeclContext *CurContext, if (ObjCProtocolDecl *Proto = dyn_cast<ObjCProtocolDecl>(*D)) if (!OnlyForwardDeclarations || !Proto->hasDefinition()) Results.AddResult(Result(Proto, 0), CurContext, 0, false); - - // Record any forward-declared protocols we find. - if (ObjCForwardProtocolDecl *Forward - = dyn_cast<ObjCForwardProtocolDecl>(*D)) { - for (ObjCForwardProtocolDecl::protocol_iterator - P = Forward->protocol_begin(), - PEnd = Forward->protocol_end(); - P != PEnd; ++P) - if (!OnlyForwardDeclarations || !(*P)->hasDefinition()) - Results.AddResult(Result(*P, 0), CurContext, 0, false); - } } } |