summaryrefslogtreecommitdiffstats
path: root/clang/tools/index-test/index-test.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-09-29 19:44:27 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-09-29 19:44:27 +0000
commit4cbe85904c8f3e03b0714535195ce14d2a147cb3 (patch)
tree8937cc3923a17f2a654ac4276f06c888c6ad9b92 /clang/tools/index-test/index-test.cpp
parent73360e1bbbb17d9fd9f95943d928663c36d12106 (diff)
downloadbcm5719-llvm-4cbe85904c8f3e03b0714535195ce14d2a147cb3.tar.gz
bcm5719-llvm-4cbe85904c8f3e03b0714535195ce14d2a147cb3.zip
Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference -A TypeLoc llvm-svn: 83095
Diffstat (limited to 'clang/tools/index-test/index-test.cpp')
-rw-r--r--clang/tools/index-test/index-test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/tools/index-test/index-test.cpp b/clang/tools/index-test/index-test.cpp
index decc921ded7..103874c77d7 100644
--- a/clang/tools/index-test/index-test.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud