From e6e48b1490fe79ca8d44718e48f8644a28efa097 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 1 Jan 2012 19:29:29 +0000 Subject: Move the data that corresponds to the definition of a protocol into a separately-allocated DefinitionData structure. Introduce various functions that will help with the separation of declarations from definitions (isThisDeclarationADefinition(), hasDefinition(), getDefinition()). llvm-svn: 147408 --- clang/tools/libclang/IndexingContext.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'clang/tools/libclang/IndexingContext.cpp') diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 49dfa05cf1c..28efe3fd569 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/tools/libclang/IndexingContext.cpp @@ -368,8 +368,9 @@ bool IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) { } ObjCProtocolList EmptyProtoList; - ObjCProtocolListInfo ProtInfo(D->hasDefinition() ? D->getReferencedProtocols() - : EmptyProtoList, + ObjCProtocolListInfo ProtInfo(D->isThisDeclarationADefinition() + ? D->getReferencedProtocols() + : EmptyProtoList, *this, SA); ObjCInterfaceDeclInfo InterInfo(D); @@ -401,7 +402,11 @@ bool IndexingContext::handleObjCForwardProtocol(const ObjCProtocolDecl *D, bool IndexingContext::handleObjCProtocol(const ObjCProtocolDecl *D) { ScratchAlloc SA(*this); - ObjCProtocolListInfo ProtListInfo(D->getReferencedProtocols(), *this, SA); + ObjCProtocolList EmptyProtoList; + ObjCProtocolListInfo ProtListInfo(D->isThisDeclarationADefinition() + ? D->getReferencedProtocols() + : EmptyProtoList, + *this, SA); ObjCProtocolDeclInfo ProtInfo(D); ProtInfo.ObjCProtoRefListInfo = ProtListInfo.getListInfo(); -- cgit v1.2.3