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/CIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/tools/libclang/CIndex.cpp') diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 33feadfdf1b..f2e6b01329a 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -4126,8 +4126,8 @@ CXCursor clang_getCursorDefinition(CXCursor C) { return clang_getNullCursor(); case Decl::ObjCProtocol: - if (!cast(D)->isForwardDecl()) - return C; + if (ObjCProtocolDecl *Def = cast(D)->getDefinition()) + return MakeCXCursor(Def, TU); return clang_getNullCursor(); case Decl::ObjCInterface: { -- cgit v1.2.3