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
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index cb81988..61e9210 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -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()) {