[libclang] When annotating tokens, don't override a property annotation with a getter/setter method annotation.
rdar://13764549
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183242 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index dacd46e..83b2519 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -5179,6 +5179,11 @@
HasContextSensitiveKeywords = true;
}
}
+
+ // Don't override a property annotation with its getter/setter method.
+ if (cursor.kind == CXCursor_ObjCInstanceMethodDecl &&
+ parent.kind == CXCursor_ObjCPropertyDecl)
+ return CXChildVisit_Continue;
if (clang_isPreprocessing(cursor.kind)) {
// Items in the preprocessing record are kept separate from items in