diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 | 
| commit | b3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch) | |
| tree | 60a1694bec5a44d15456acc880cb2f91619f66aa /lib/Index/ResolveLocation.cpp | |
| parent | 8f57cb0305232cb53fff00ef151ca716766f3437 (diff) | |
Notes
Diffstat (limited to 'lib/Index/ResolveLocation.cpp')
| -rw-r--r-- | lib/Index/ResolveLocation.cpp | 14 | 
1 files changed, 13 insertions, 1 deletions
| diff --git a/lib/Index/ResolveLocation.cpp b/lib/Index/ResolveLocation.cpp index 73b584b5205d..ed905f364f0d 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"); @@ -484,7 +496,7 @@ ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,    assert(ContainsLocation(DInfo) &&           "Should visit only after verifying that loc is in range"); -  TypeLocResolver(Ctx, Loc, D); +  (void)TypeLocResolver(Ctx, Loc, D);    for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())      if (ContainsLocation(TL))        return TypeLocResolver(Ctx, Loc, D).Visit(TL); | 
