diff options
Diffstat (limited to 'clang-query')
-rw-r--r-- | clang-query/Query.cpp | 9 | ||||
-rw-r--r-- | clang-query/QueryParser.cpp | 4 | ||||
-rw-r--r-- | clang-query/tool/ClangQuery.cpp | 8 |
3 files changed, 6 insertions, 15 deletions
diff --git a/clang-query/Query.cpp b/clang-query/Query.cpp index ed27c211..b3344dad 100644 --- a/clang-query/Query.cpp +++ b/clang-query/Query.cpp @@ -86,14 +86,11 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const { } Finder.matchAST(AST->getASTContext()); - for (std::vector<BoundNodes>::iterator MI = Matches.begin(), - ME = Matches.end(); - MI != ME; ++MI) { + for (auto MI = Matches.begin(), ME = Matches.end(); MI != ME; ++MI) { OS << "\nMatch #" << ++MatchCount << ":\n\n"; - for (BoundNodes::IDToNodeMap::const_iterator BI = MI->getMap().begin(), - BE = MI->getMap().end(); - BI != BE; ++BI) { + for (auto BI = MI->getMap().begin(), BE = MI->getMap().end(); BI != BE; + ++BI) { switch (QS.OutKind) { case OK_Diag: { clang::SourceRange R = BI->second.getSourceRange(); diff --git a/clang-query/QueryParser.cpp b/clang-query/QueryParser.cpp index 15d6bbc1..c64d810a 100644 --- a/clang-query/QueryParser.cpp +++ b/clang-query/QueryParser.cpp @@ -158,9 +158,7 @@ QueryRef QueryParser::completeMatcherExpression() { std::vector<MatcherCompletion> Comps = Parser::completeExpression( StringRef(Begin, End - Begin), CompletionPos - Begin, nullptr, &QS.NamedValues); - for (std::vector<MatcherCompletion>::iterator I = Comps.begin(), - E = Comps.end(); - I != E; ++I) { + for (auto I = Comps.begin(), E = Comps.end(); I != E; ++I) { Completions.push_back(LineEditor::Completion(I->TypedText, I->MatcherDecl)); } return QueryRef(); diff --git a/clang-query/tool/ClangQuery.cpp b/clang-query/tool/ClangQuery.cpp index 990b82b3..669dc40e 100644 --- a/clang-query/tool/ClangQuery.cpp +++ b/clang-query/tool/ClangQuery.cpp @@ -77,17 +77,13 @@ int main(int argc, const char **argv) { QuerySession QS(ASTs); if (!Commands.empty()) { - for (cl::list<std::string>::iterator I = Commands.begin(), - E = Commands.end(); - I != E; ++I) { + for (auto I = Commands.begin(), E = Commands.end(); I != E; ++I) { QueryRef Q = QueryParser::parse(*I, QS); if (!Q->run(llvm::outs(), QS)) return 1; } } else if (!CommandFiles.empty()) { - for (cl::list<std::string>::iterator I = CommandFiles.begin(), - E = CommandFiles.end(); - I != E; ++I) { + for (auto I = CommandFiles.begin(), E = CommandFiles.end(); I != E; ++I) { std::ifstream Input(I->c_str()); if (!Input.is_open()) { llvm::errs() << argv[0] << ": cannot open " << *I << "\n"; |