diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-11-18 02:02:52 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-11-18 02:02:52 +0000 |
commit | 1d5fdf3d3b5ea2640ebe8673814a0b6ab7cf5eb2 (patch) | |
tree | 446e905eb89ba6af210853729e519756b66be4d6 /lib/Index/ResolveLocation.cpp | |
parent | 95ac6556a5dfc504491103c37f9aa05b303d2729 (diff) |
Add special clang_getCursor() support for @class. Handles <rdar://problem/7383421>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Index/ResolveLocation.cpp')
-rw-r--r-- | lib/Index/ResolveLocation.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Index/ResolveLocation.cpp b/lib/Index/ResolveLocation.cpp index 35a44ca166..ed905f364f 100644 --- a/lib/Index/ResolveLocation.cpp +++ b/lib/Index/ResolveLocation.cpp @@ -112,6 +112,7 @@ public: ASTLocation VisitDeclaratorDecl(DeclaratorDecl *D); ASTLocation VisitVarDecl(VarDecl *D); ASTLocation VisitFunctionDecl(FunctionDecl *D); + ASTLocation VisitObjCClassDecl(ObjCClassDecl *D); ASTLocation VisitObjCMethodDecl(ObjCMethodDecl *D); ASTLocation VisitTypedefDecl(TypedefDecl *D); ASTLocation VisitDecl(Decl *D); @@ -327,6 +328,17 @@ ASTLocation DeclLocResolver::VisitVarDecl(VarDecl *D) { return ASTLocation(D); } +ASTLocation DeclLocResolver::VisitObjCClassDecl(ObjCClassDecl *D) { + assert(ContainsLocation(D) && + "Should visit only after verifying that loc is in range"); + + for (ObjCClassDecl::iterator I = D->begin(), E = D->end() ; I != E; ++I) { + if (CheckRange(I->getLocation()) == ContainsLoc) + return ASTLocation(D, I->getInterface(), I->getLocation()); + } + return ASTLocation(D); +} + ASTLocation DeclLocResolver::VisitObjCMethodDecl(ObjCMethodDecl *D) { assert(ContainsLocation(D) && "Should visit only after verifying that loc is in range"); |