[cfe-commits] r96599 - in /cfe/trunk: test/Index/c-index-api-loadTU-test.m tools/CIndex/CIndex.cpp

Ted Kremenek kremenek at apple.com
Thu Feb 18 10:47:02 PST 2010


Author: kremenek
Date: Thu Feb 18 12:47:01 2010
New Revision: 96599

URL: http://llvm.org/viewvc/llvm-project?rev=96599&view=rev
Log:
Change cursor behavior for attributes to have them visited as part of recursing
to the children of a Decl.

Modified:
    cfe/trunk/test/Index/c-index-api-loadTU-test.m
    cfe/trunk/tools/CIndex/CIndex.cpp

Modified: cfe/trunk/test/Index/c-index-api-loadTU-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/c-index-api-loadTU-test.m?rev=96599&r1=96598&r2=96599&view=diff

==============================================================================
--- cfe/trunk/test/Index/c-index-api-loadTU-test.m (original)
+++ cfe/trunk/test/Index/c-index-api-loadTU-test.m Thu Feb 18 12:47:01 2010
@@ -55,8 +55,8 @@
 }
 
 // CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 12:5]
-// CHECK: c-index-api-loadTU-test.m:6:32: attribute(iboutlet)= Extent=[6:32 - 6:40]
 // CHECK: c-index-api-loadTU-test.m:6:32: ObjCIvarDecl=myoutlet:6:32 (Definition) Extent=[6:32 - 6:40]
+// CHECK: c-index-api-loadTU-test.m:6:32: attribute(iboutlet)= Extent=[6:32 - 6:40]
 // CHECK: c-index-api-loadTU-test.m:6:29: TypeRef=id:0:0 Extent=[6:29 - 6:31]
 // CHECK: c-index-api-loadTU-test.m:9:1: ObjCInstanceMethodDecl=foo:9:1 Extent=[9:1 - 9:7]
 // CHECK: c-index-api-loadTU-test.m:10:1: ObjCClassMethodDecl=fooC:10:1 Extent=[10:1 - 10:8]

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=96599&r1=96598&r2=96599&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Thu Feb 18 12:47:01 2010
@@ -404,7 +404,7 @@
   if (clang_isDeclaration(Cursor.kind)) {
     Decl *D = getCursorDecl(Cursor);
     assert(D && "Invalid declaration cursor");
-    return Visit(D);
+    return VisitAttributes(D) || Visit(D);
   }
 
   if (clang_isStatement(Cursor.kind))
@@ -438,12 +438,6 @@
   for (DeclContext::decl_iterator
        I = DC->decls_begin(), E = DC->decls_end(); I != E; ++I) {
 
-    // Attributes currently don't have source ranges.  We only report them
-    // when the client hasn't specified a region of interest.
-    if (!RegionOfInterest.isValid())
-      if (VisitAttributes(*I))
-        return true;
-
     CXCursor Cursor = MakeCXCursor(*I, TU);
 
     if (RegionOfInterest.isValid()) {





More information about the cfe-commits mailing list