diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-26 19:05:37 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-26 19:05:37 +0000 |
commit | 65ab90736ede3932b26848e39c64396c47f2941b (patch) | |
tree | e05678915e146ce902508d420b2d8ba7bb306eb2 /tools/libclang/CIndex.cpp | |
parent | a4e20e1e43df39e39328035c84c46fdcbbf3a01e (diff) |
[libclang] Report implicit objc methods for properties when indexing.
Related to rdar://10087069.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndex.cpp')
-rw-r--r-- | tools/libclang/CIndex.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 30db13190c..e183de1370 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -365,7 +365,9 @@ bool CursorVisitor::Visit(CXCursor Cursor, bool CheckedRegionOfInterest) { if (clang_isDeclaration(Cursor.kind)) { Decl *D = getCursorDecl(Cursor); assert(D && "Invalid declaration cursor"); - if (D->isImplicit()) + // Ignore implicit declarations, unless it's an objc method because + // currently we should report implicit methods for properties when indexing. + if (D->isImplicit() && !isa<ObjCMethodDecl>(D)) return false; } @@ -3446,6 +3448,13 @@ static enum CXChildVisitResult GetCursorVisitor(CXCursor cursor, // cursor. if (cursor.kind == CXCursor_MacroExpansion && Data->PointsAtMacroArgExpansion) return CXChildVisit_Recurse; + + if (clang_isDeclaration(cursor.kind)) { + // Avoid having the implicit methods override the property decls. + if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(getCursorDecl(cursor))) + if (MD->isImplicit()) + return CXChildVisit_Break; + } if (clang_isExpression(cursor.kind) && clang_isDeclaration(BestCursor->kind)) { |