]> granicus.if.org Git - clang/commitdiff
[libclang] Indexing API: Pass an implicit ObjCInterfaceDecl (@implementation without...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 15 Nov 2011 06:20:24 +0000 (06:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 15 Nov 2011 06:20:24 +0000 (06:20 +0000)
in a separate indexing callback than its implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144625 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/IndexDecl.cpp
tools/libclang/IndexingContext.cpp

index 67f6703e75a7f15f9c1dab39474de86fd40718af..b2a45306dc9b955d10bdc6ce36b30964939d2cc0 100644 (file)
@@ -108,6 +108,10 @@ public:
   }
 
   bool VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
+    const ObjCInterfaceDecl *Class = D->getClassInterface();
+    if (Class->isImplicitInterfaceDecl())
+      IndexCtx.handleObjCInterface(Class);
+
     IndexCtx.handleObjCImplementation(D);
 
     IndexCtx.indexTUDeclsInObjCContainer();
index 3ab29e2e5bfed409db859b929556b56369316e4c..a6e968b8fe06111696ababa162c3a493863e27cf 100644 (file)
@@ -206,9 +206,8 @@ void IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) {
 
 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);
 }