aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-18 18:47:01 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-18 18:47:01 +0000
commit539311e0221df256c70c1c3080c8af847cd29dff (patch)
tree3fdd361a45d8836cb5e4130ce9f5c53d6e52324b
parent71b202e1d1a92aee9e71b126d653652e2114df25 (diff)
Change cursor behavior for attributes to have them visited as part of recursing
to the children of a Decl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96599 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Index/c-index-api-loadTU-test.m2
-rw-r--r--tools/CIndex/CIndex.cpp8
2 files changed, 2 insertions, 8 deletions
diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m
index 5559903068..85cfac37be 100644
--- a/test/Index/c-index-api-loadTU-test.m
+++ b/test/Index/c-index-api-loadTU-test.m
@@ -55,8 +55,8 @@ int main (int argc, const char * argv[]) {
}
// 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]
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index cb81988d95..61e9210aa5 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -404,7 +404,7 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) {
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 @@ bool CursorVisitor::VisitDeclContext(DeclContext *DC) {
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()) {