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 | 0469b7ea00e97700646ca1a873dee4ada131689e (patch) | |
| tree | 8f39e8fba08a839a6893f2daf83a92f0ba94e6cd /clang/lib/Index | |
| parent | 9291bade4fff47783548ba73a6b0e1b8e18b9523 (diff) | |
| download | bcm5719-llvm-0469b7ea00e97700646ca1a873dee4ada131689e.tar.gz bcm5719-llvm-0469b7ea00e97700646ca1a873dee4ada131689e.zip | |
Add special clang_getCursor() support for @class. Handles <rdar://problem/7383421>.
llvm-svn: 89183
Diffstat (limited to 'clang/lib/Index')
| -rw-r--r-- | clang/lib/Index/ResolveLocation.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Index/ResolveLocation.cpp b/clang/lib/Index/ResolveLocation.cpp index 35a44ca166a..ed905f364f0 100644 --- a/clang/lib/Index/ResolveLocation.cpp +++ b/clang/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"); |

