summaryrefslogtreecommitdiffstats
path: root/clang-query
diff options
context:
space:
mode:
authorPiotr Padlewski <piotr.padlewski@gmail.com>2016-12-14 15:29:23 +0000
committerPiotr Padlewski <piotr.padlewski@gmail.com>2016-12-14 15:29:23 +0000
commit2cd835ee5bcd6c4944d7e30826668ec38db40b38 (patch)
tree2bc808fbc178d42948b8ae138e1ee3d696ec6c8b /clang-query
parent0d8381bb69ca54a450b730ff3ee59133ecd0d09a (diff)
modernize-use-auto NFC fixes
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@289656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-query')
-rw-r--r--clang-query/Query.cpp9
-rw-r--r--clang-query/QueryParser.cpp4
-rw-r--r--clang-query/tool/ClangQuery.cpp8
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";