diff options
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index 88fd2417ac..2010434b7b 100644 --- a/tools/index-test/index-test.cpp +++ b/tools/index-test/index-test.cpp @@ -62,11 +62,11 @@ public: : AST(ast), Filename(filename), DeclRefMap(ast->getASTContext()), SelMap(ast->getASTContext()) { } - + virtual ASTContext &getASTContext() { return AST->getASTContext(); } virtual DeclReferenceMap &getDeclReferenceMap() { return DeclRefMap; } virtual SelectorMap &getSelectorMap() { return SelMap; } - + llvm::OwningPtr<ASTUnit> AST; std::string Filename; DeclReferenceMap DeclRefMap; @@ -85,7 +85,7 @@ enum ProgActions { PrintDecls // Print declarations of the point-at node }; -static llvm::cl::opt<ProgActions> +static llvm::cl::opt<ProgActions> ProgAction( llvm::cl::desc("Choose action to perform on the pointed-at AST node:"), llvm::cl::ZeroOrMore, @@ -119,7 +119,7 @@ static void ProcessObjCMessage(ObjCMessageExpr *Msg, Indexer &Idxer) { llvm::errs() << "Error: Cannot -print-refs on a ObjC message expression\n"; HadErrors = true; return; - + case PrintDecls: { Analyz.FindObjCMethods(Msg, Results); for (ResultsTy::iterator @@ -144,7 +144,7 @@ static void ProcessObjCMessage(ObjCMessageExpr *Msg, Indexer &Idxer) { static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) { assert(ASTLoc.isValid()); - + if (ObjCMessageExpr *Msg = dyn_cast_or_null<ObjCMessageExpr>(ASTLoc.getStmt())) return ProcessObjCMessage(Msg, Idxer); @@ -210,20 +210,20 @@ int main(int argc, char **argv) { llvm::PrettyStackTraceProgram X(argc, argv); llvm::cl::ParseCommandLineOptions(argc, argv, "LLVM 'Clang' Indexing Test Bed: http://clang.llvm.org\n"); - + FileManager FileMgr; Program Prog; Indexer Idxer(Prog, FileMgr); llvm::SmallVector<TUnit*, 4> TUnits; - + // If no input was specified, read from stdin. if (InputFilenames.empty()) InputFilenames.push_back("-"); for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) { const std::string &InFile = InputFilenames[i]; - + std::string ErrMsg; llvm::OwningPtr<ASTUnit> AST; @@ -235,7 +235,7 @@ int main(int argc, char **argv) { TUnit *TU = new TUnit(AST.take(), InFile); TUnits.push_back(TU); - + Idxer.IndexAST(TU); } @@ -272,7 +272,7 @@ int main(int argc, char **argv) { "Couldn't resolve source location (invalid location)\n"; return 1; } - + ASTLoc = ResolveLocationInAST(FirstAST->getASTContext(), Loc); if (ASTLoc.isInvalid()) { llvm::errs() << "[" << FirstFile << "] Error: " << @@ -280,7 +280,7 @@ int main(int argc, char **argv) { return 1; } } - + if (ASTLoc.isValid()) { if (ProgAction == PrintPoint) { llvm::raw_ostream &OS = llvm::outs(); @@ -292,7 +292,7 @@ int main(int argc, char **argv) { ProcessASTLocation(ASTLoc, Idxer); } } - + if (HadErrors) return 1; @@ -304,6 +304,6 @@ int main(int argc, char **argv) { // Managed static deconstruction. Useful for making things like // -time-passes usable. llvm::llvm_shutdown(); - + return 0; } |