diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:44:27 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:44:27 +0000 |
commit | f4526e3fd48248af78b3d59ec36a37bc055b326f (patch) | |
tree | 937143c4352bb089ece89213bf9649d7a2f2e25a /tools/index-test/index-test.cpp | |
parent | f352bddf015e537350416c296dd2963524f554f9 (diff) |
Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference
-A TypeLoc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index decc921ded..103874c77d 100644 --- a/tools/index-test/index-test.cpp +++ b/tools/index-test/index-test.cpp @@ -132,7 +132,7 @@ static void ProcessObjCMessage(ObjCMessageExpr *Msg, Indexer &Idxer) { Analyz.FindObjCMethods(Msg, Results); for (ResultsTy::iterator I = Results.begin(), E = Results.end(); I != E; ++I) { - const ObjCMethodDecl *D = cast<ObjCMethodDecl>(I->getDecl()); + const ObjCMethodDecl *D = cast<ObjCMethodDecl>(I->AsDecl()); if (D->isThisDeclarationADefinition()) I->print(OS); } @@ -146,7 +146,7 @@ static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) { assert(ASTLoc.isValid()); if (ObjCMessageExpr *Msg = - dyn_cast_or_null<ObjCMessageExpr>(ASTLoc.getStmt())) + dyn_cast_or_null<ObjCMessageExpr>(ASTLoc.dyn_AsStmt())) return ProcessObjCMessage(Msg, Idxer); Decl *D = ASTLoc.getReferencedDecl(); @@ -184,7 +184,7 @@ static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) { Analyz.FindDeclarations(D, Results); for (ResultsTy::iterator I = Results.begin(), E = Results.end(); I != E; ++I) { - const Decl *D = I->getDecl(); + const Decl *D = I->AsDecl(); bool isDef = false; if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) isDef = FD->isThisDeclarationADefinition(); @@ -285,7 +285,7 @@ int main(int argc, char **argv) { llvm::raw_ostream &OS = llvm::outs(); ASTLoc.print(OS); if (const char *Comment = - FirstAST->getASTContext().getCommentForDecl(ASTLoc.getDecl())) + FirstAST->getASTContext().getCommentForDecl(ASTLoc.dyn_AsDecl())) OS << "Comment associated with this declaration:\n" << Comment << "\n"; } else { ProcessASTLocation(ASTLoc, Idxer); |