[cfe-commits] r144625 - in /cfe/trunk/tools/libclang: IndexDecl.cpp IndexingContext.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Nov 14 22:20:24 PST 2011


Author: akirtzidis
Date: Tue Nov 15 00:20:24 2011
New Revision: 144625

URL: http://llvm.org/viewvc/llvm-project?rev=144625&view=rev
Log:
[libclang] Indexing API: Pass an implicit ObjCInterfaceDecl (@implementation without @interface)
in a separate indexing callback than its implementation.

Modified:
    cfe/trunk/tools/libclang/IndexDecl.cpp
    cfe/trunk/tools/libclang/IndexingContext.cpp

Modified: cfe/trunk/tools/libclang/IndexDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexDecl.cpp?rev=144625&r1=144624&r2=144625&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexDecl.cpp (original)
+++ cfe/trunk/tools/libclang/IndexDecl.cpp Tue Nov 15 00:20:24 2011
@@ -108,6 +108,10 @@
   }
 
   bool VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
+    const ObjCInterfaceDecl *Class = D->getClassInterface();
+    if (Class->isImplicitInterfaceDecl())
+      IndexCtx.handleObjCInterface(Class);
+
     IndexCtx.handleObjCImplementation(D);
 
     IndexCtx.indexTUDeclsInObjCContainer();

Modified: cfe/trunk/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=144625&r1=144624&r2=144625&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.cpp (original)
+++ cfe/trunk/tools/libclang/IndexingContext.cpp Tue Nov 15 00:20:24 2011
@@ -206,9 +206,8 @@
 
 void IndexingContext::handleObjCImplementation(
                                               const ObjCImplementationDecl *D) {
-  const ObjCInterfaceDecl *Class = D->getClassInterface();
   ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/false,
-                      /*isRedeclaration=*/!Class->isImplicitInterfaceDecl(),
+                      /*isRedeclaration=*/true,
                       /*isImplementation=*/true);
   handleObjCContainer(D, D->getLocation(), getCursor(D), ContDInfo);
 }





More information about the cfe-commits mailing list