summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-01 21:23:57 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-01 21:23:57 +0000
commitf61026758145df2f845f9c28e89f53c084d35cb2 (patch)
tree24699428a99f060286b52844b9d54089e363da38 /clang/tools/libclang/IndexingContext.cpp
parentc51118238c9a05a3113ce0057bb10169b583a6c5 (diff)
downloadbcm5719-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/tools/libclang/IndexingContext.cpp')
-rw-r--r--clang/tools/libclang/IndexingContext.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp
index 28efe3fd569..14dbc970025 100644
--- a/clang/tools/libclang/IndexingContext.cpp
+++ b/clang/tools/libclang/IndexingContext.cpp
@@ -390,17 +390,22 @@ bool IndexingContext::handleObjCImplementation(
return handleObjCContainer(D, D->getLocation(), getCursor(D), ContDInfo);
}
-bool IndexingContext::handleObjCForwardProtocol(const ObjCProtocolDecl *D,
- SourceLocation Loc,
- bool isRedeclaration) {
- ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true,
- isRedeclaration,
- /*isImplementation=*/false);
- return handleObjCContainer(D, Loc, MakeCursorObjCProtocolRef(D, Loc, CXTU),
- ContDInfo);
-}
-
bool IndexingContext::handleObjCProtocol(const ObjCProtocolDecl *D) {
+ if (!D->isThisDeclarationADefinition()) {
+ if (suppressRefs() && markEntityOccurrenceInFile(D, D->getLocation()))
+ return false; // already occurred.
+
+ // FIXME: This seems like the wrong definition for redeclaration.
+ bool isRedeclaration = D->hasDefinition() || D->getPreviousDeclaration();
+ ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true,
+ isRedeclaration,
+ /*isImplementation=*/false);
+ return handleObjCContainer(D, D->getLocation(),
+ MakeCursorObjCProtocolRef(D, D->getLocation(),
+ CXTU),
+ ContDInfo);
+ }
+
ScratchAlloc SA(*this);
ObjCProtocolList EmptyProtoList;
ObjCProtocolListInfo ProtListInfo(D->isThisDeclarationADefinition()
OpenPOWER on IntegriCloud