From 2cd835ee5bcd6c4944d7e30826668ec38db40b38 Mon Sep 17 00:00:00 2001 From: Piotr Padlewski Date: Wed, 14 Dec 2016 15:29:23 +0000 Subject: modernize-use-auto NFC fixes git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@289656 91177308-0d34-0410-b5e6-96231b3b80d8 --- clang-query/Query.cpp | 9 +++------ clang-query/QueryParser.cpp | 4 +--- clang-query/tool/ClangQuery.cpp | 8 ++------ 3 files changed, 6 insertions(+), 15 deletions(-) (limited to 'clang-query') 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::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 Comps = Parser::completeExpression( StringRef(Begin, End - Begin), CompletionPos - Begin, nullptr, &QS.NamedValues); - for (std::vector::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::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::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"; -- cgit v1.2.3