diff options
Diffstat (limited to 'tools/libclang/CXCursor.cpp')
-rw-r--r-- | tools/libclang/CXCursor.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp index e490b5da3d..b5682055b9 100644 --- a/tools/libclang/CXCursor.cpp +++ b/tools/libclang/CXCursor.cpp @@ -435,7 +435,21 @@ CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent, K = CXCursor_SizeOfPackExpr; break; - case Stmt::DeclRefExprClass: + case Stmt::DeclRefExprClass: + if (const ImplicitParamDecl *IPD = + dyn_cast_or_null<ImplicitParamDecl>(cast<DeclRefExpr>(S)->getDecl())) { + if (const ObjCMethodDecl *MD = + dyn_cast<ObjCMethodDecl>(IPD->getDeclContext())) { + if (MD->getSelfDecl() == IPD) { + K = CXCursor_ObjCSelfExpr; + break; + } + } + } + + K = CXCursor_DeclRefExpr; + break; + case Stmt::DependentScopeDeclRefExprClass: case Stmt::SubstNonTypeTemplateParmExprClass: case Stmt::SubstNonTypeTemplateParmPackExprClass: |