aboutsummaryrefslogtreecommitdiff
path: root/tools/index-test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-06 21:35:26 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-06 21:35:26 +0000
commit44994051cab48624be883cef7ce02241d5ce0797 (patch)
treef546ecb37c4d5365fb7f94d860620293bb757780 /tools/index-test
parent755c6b42154e7c2225d973babf84eb2587576bcd (diff)
Use the "ASTLocation nomenclature" (instead of the ASTNode one) in index-test.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/index-test')
-rw-r--r--tools/index-test/index-test.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp
index c9c0898646..b30de31706 100644
--- a/tools/index-test/index-test.cpp
+++ b/tools/index-test/index-test.cpp
@@ -148,15 +148,15 @@ static void ProcessDecl(Decl *D) {
}
}
-static void ProcessNode(ASTLocation Node, IndexProvider &IdxProvider) {
- assert(Node.isValid());
+static void ProcessASTLocation(ASTLocation ASTLoc, IndexProvider &IdxProvider) {
+ assert(ASTLoc.isValid());
Decl *D = 0;
- if (Node.isStmt()) {
- if (DeclRefExpr *RefExpr = dyn_cast<DeclRefExpr>(Node.getStmt()))
+ if (ASTLoc.isStmt()) {
+ if (DeclRefExpr *RefExpr = dyn_cast<DeclRefExpr>(ASTLoc.getStmt()))
D = RefExpr->getDecl();
} else {
- D = Node.getDecl();
+ D = ASTLoc.getDecl();
}
assert(D);
@@ -214,7 +214,7 @@ int main(int argc, char **argv) {
IdxProvider.IndexAST(TU);
}
- ASTLocation Node;
+ ASTLocation ASTLoc;
const std::string &FirstFile = TUnits[0]->Filename;
ASTUnit *FirstAST = TUnits[0]->AST.get();
@@ -248,23 +248,23 @@ int main(int argc, char **argv) {
return 1;
}
- Node = ResolveLocationInAST(FirstAST->getASTContext(), Loc);
- if (Node.isInvalid()) {
+ ASTLoc = ResolveLocationInAST(FirstAST->getASTContext(), Loc);
+ if (ASTLoc.isInvalid()) {
llvm::errs() << "[" << FirstFile << "] Error: " <<
"Couldn't resolve source location (no declaration found)\n";
return 1;
}
}
- if (Node.isValid()) {
+ if (ASTLoc.isValid()) {
if (ProgAction == PrintPoint) {
llvm::raw_ostream &OS = llvm::outs();
- Node.print(OS);
+ ASTLoc.print(OS);
if (const char *Comment =
- FirstAST->getASTContext().getCommentForDecl(Node.getDecl()))
+ FirstAST->getASTContext().getCommentForDecl(ASTLoc.getDecl()))
OS << "Comment associated with this declaration:\n" << Comment << "\n";
} else {
- ProcessNode(Node, IdxProvider);
+ ProcessASTLocation(ASTLoc, IdxProvider);
}
}