<div dir="ltr">For most loop changes here applying modernize-loop-convert would be better ;)</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 14, 2016 at 4:29 PM, Piotr Padlewski via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: prazek<br>
Date: Wed Dec 14 09:29:23 2016<br>
New Revision: 289656<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=289656&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=289656&view=rev</a><br>
Log:<br>
modernize-use-auto NFC fixes<br>
<br>
Modified:<br>
clang-tools-extra/trunk/<wbr>change-namespace/<wbr>ChangeNamespace.cpp<br>
clang-tools-extra/trunk/clang-<wbr>apply-replacements/lib/<wbr>Tooling/ApplyReplacements.cpp<br>
clang-tools-extra/trunk/clang-<wbr>query/Query.cpp<br>
clang-tools-extra/trunk/clang-<wbr>query/QueryParser.cpp<br>
clang-tools-extra/trunk/clang-<wbr>query/tool/ClangQuery.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>ProTypeMemberInitCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>SpecialMemberFunctionsCheck.<wbr>cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>ExplicitConstructorCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>NonConstReferences.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/llvm/TwineLocalCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ArgumentCommentCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MoveForwardingReferenceCheck.<wbr>cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MultipleStatementMacroCheck.<wbr>cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ThrowByValueCatchByReferenceCh<wbr>eck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseNullptrCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseOverrideCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/mpi/TypeMismatchCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>ImplicitBoolCastCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>NamespaceCommentCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantDeclarationCheck.cpp<br>
clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantSmartptrGetCheck.cpp<br>
clang-tools-extra/trunk/<wbr>include-fixer/find-all-<wbr>symbols/FindAllSymbols.cpp<br>
clang-tools-extra/trunk/<wbr>modularize/CoverageChecker.cpp<br>
clang-tools-extra/trunk/<wbr>modularize/Modularize.cpp<br>
clang-tools-extra/trunk/<wbr>modularize/<wbr>ModularizeUtilities.cpp<br>
clang-tools-extra/trunk/<wbr>modularize/ModuleAssistant.cpp<br>
clang-tools-extra/trunk/<wbr>modularize/<wbr>PreprocessorTracker.cpp<br>
clang-tools-extra/trunk/pp-<wbr>trace/PPTrace.cpp<br>
clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>ClangTidyDiagnosticConsumerTes<wbr>t.cpp<br>
clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>NamespaceAliaserTest.cpp<br>
clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>UsingInserterTest.cpp<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>change-namespace/<wbr>ChangeNamespace.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/change-namespace/<wbr>ChangeNamespace.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>change-namespace/<wbr>ChangeNamespace.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>change-namespace/<wbr>ChangeNamespace.cpp Wed Dec 14 09:29:23 2016<br>
@@ -709,7 +709,7 @@ void ChangeNamespaceTool::<wbr>fixTypeLoc(<br>
return;<br>
}<br>
<br>
- const Decl *DeclCtx = Result.Nodes.getNodeAs<Decl>("<wbr>dc");<br>
+ const auto *DeclCtx = Result.Nodes.getNodeAs<Decl>("<wbr>dc");<br>
assert(DeclCtx && "Empty decl context.");<br>
replaceQualifiedSymbolInDeclCo<wbr>ntext(Result, DeclCtx->getDeclContext(), Start,<br>
End, FromDecl);<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>apply-replacements/lib/<wbr>Tooling/ApplyReplacements.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-apply-<wbr>replacements/lib/Tooling/<wbr>ApplyReplacements.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>apply-replacements/lib/<wbr>Tooling/ApplyReplacements.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>apply-replacements/lib/<wbr>Tooling/ApplyReplacements.cpp Wed Dec 14 09:29:23 2016<br>
@@ -124,9 +124,7 @@ static void reportConflict(<br>
bool applyAllReplacements(const std::vector<tooling::<wbr>Replacement> &Replaces,<br>
Rewriter &Rewrite) {<br>
bool Result = true;<br>
- for (std::vector<tooling::<wbr>Replacement>::const_iterator I = Replaces.begin(),<br>
- E = Replaces.end();<br>
- I != E; ++I) {<br>
+ for (auto I = Replaces.begin(), E = Replaces.end(); I != E; ++I) {<br>
if (I->isApplicable()) {<br>
Result = I->apply(Rewrite) && Result;<br>
} else {<br>
@@ -293,8 +291,7 @@ RangeVector calculateChangedRanges(<br>
<br>
bool writeFiles(const clang::Rewriter &Rewrites) {<br>
<br>
- for (Rewriter::const_buffer_<wbr>iterator BufferI = Rewrites.buffer_begin(),<br>
- BufferE = Rewrites.buffer_end();<br>
+ for (auto BufferI = Rewrites.buffer_begin(), BufferE = Rewrites.buffer_end();<br>
BufferI != BufferE; ++BufferI) {<br>
StringRef FileName =<br>
Rewrites.getSourceMgr().<wbr>getFileEntryForID(BufferI-><wbr>first)->getName();<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>query/Query.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-query/Query.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-query/Query.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>query/Query.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>query/Query.cpp Wed Dec 14 09:29:23 2016<br>
@@ -86,14 +86,11 @@ bool MatchQuery::run(llvm::raw_<wbr>ostream &<br>
}<br>
Finder.matchAST(AST-><wbr>getASTContext());<br>
<br>
- for (std::vector<BoundNodes>::<wbr>iterator MI = Matches.begin(),<br>
- ME = Matches.end();<br>
- MI != ME; ++MI) {<br>
+ for (auto MI = Matches.begin(), ME = Matches.end(); MI != ME; ++MI) {<br>
OS << "\nMatch #" << ++MatchCount << ":\n\n";<br>
<br>
- for (BoundNodes::IDToNodeMap::<wbr>const_iterator BI = MI->getMap().begin(),<br>
- BE = MI->getMap().end();<br>
- BI != BE; ++BI) {<br>
+ for (auto BI = MI->getMap().begin(), BE = MI->getMap().end(); BI != BE;<br>
+ ++BI) {<br>
switch (QS.OutKind) {<br>
case OK_Diag: {<br>
clang::SourceRange R = BI->second.getSourceRange();<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>query/QueryParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-query/QueryParser.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-query/QueryParser.<wbr>cpp?rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>query/QueryParser.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>query/QueryParser.cpp Wed Dec 14 09:29:23 2016<br>
@@ -158,9 +158,7 @@ QueryRef QueryParser::<wbr>completeMatcherExp<br>
std::vector<MatcherCompletion> Comps = Parser::completeExpression(<br>
StringRef(Begin, End - Begin), CompletionPos - Begin, nullptr,<br>
&QS.NamedValues);<br>
- for (std::vector<<wbr>MatcherCompletion>::iterator I = Comps.begin(),<br>
- E = Comps.end();<br>
- I != E; ++I) {<br>
+ for (auto I = Comps.begin(), E = Comps.end(); I != E; ++I) {<br>
Completions.push_back(<wbr>LineEditor::Completion(I-><wbr>TypedText, I->MatcherDecl));<br>
}<br>
return QueryRef();<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>query/tool/ClangQuery.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-query/tool/<wbr>ClangQuery.cpp?rev=289656&r1=<wbr>289655&r2=289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>query/tool/ClangQuery.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>query/tool/ClangQuery.cpp Wed Dec 14 09:29:23 2016<br>
@@ -77,17 +77,13 @@ int main(int argc, const char **argv) {<br>
QuerySession QS(ASTs);<br>
<br>
if (!Commands.empty()) {<br>
- for (cl::list<std::string>::<wbr>iterator I = Commands.begin(),<br>
- E = Commands.end();<br>
- I != E; ++I) {<br>
+ for (auto I = Commands.begin(), E = Commands.end(); I != E; ++I) {<br>
QueryRef Q = QueryParser::parse(*I, QS);<br>
if (!Q->run(llvm::outs(), QS))<br>
return 1;<br>
}<br>
} else if (!CommandFiles.empty()) {<br>
- for (cl::list<std::string>::<wbr>iterator I = CommandFiles.begin(),<br>
- E = CommandFiles.end();<br>
- I != E; ++I) {<br>
+ for (auto I = CommandFiles.begin(), E = CommandFiles.end(); I != E; ++I) {<br>
std::ifstream Input(I->c_str());<br>
if (!Input.is_open()) {<br>
llvm::errs() << argv[0] << ": cannot open " << *I << "\n";<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>ProTypeMemberInitCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/<wbr>cppcoreguidelines/<wbr>ProTypeMemberInitCheck.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>ProTypeMemberInitCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>ProTypeMemberInitCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -196,7 +196,7 @@ computeInsertions(const CXXConstructorDe<br>
<br>
// Add all fields between current field up until the next intializer.<br>
for (; Decl != std::end(OrderedDecls) && *Decl != InitDecl; ++Decl) {<br>
- if (const T *D = dyn_cast<T>(*Decl)) {<br>
+ if (const auto *D = dyn_cast<T>(*Decl)) {<br>
if (DeclsToInit.count(D) > 0)<br>
Insertions.back().<wbr>Initializers.emplace_back(<wbr>getName(D));<br>
}<br>
@@ -208,7 +208,7 @@ computeInsertions(const CXXConstructorDe<br>
<br>
// Add remaining decls that require initialization.<br>
for (; Decl != std::end(OrderedDecls); ++Decl) {<br>
- if (const T *D = dyn_cast<T>(*Decl)) {<br>
+ if (const auto *D = dyn_cast<T>(*Decl)) {<br>
if (DeclsToInit.count(D) > 0)<br>
Insertions.back().<wbr>Initializers.emplace_back(<wbr>getName(D));<br>
}<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>SpecialMemberFunctionsCheck.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/<wbr>cppcoreguidelines/<wbr>SpecialMemberFunctionsCheck.<wbr>cpp?rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>SpecialMemberFunctionsCheck.<wbr>cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/cppcoreguidelines/<wbr>SpecialMemberFunctionsCheck.<wbr>cpp Wed Dec 14 09:29:23 2016<br>
@@ -82,8 +82,7 @@ join(ArrayRef<<wbr>SpecialMemberFunctionsChec<br>
<br>
void SpecialMemberFunctionsCheck::<wbr>check(<br>
const MatchFinder::MatchResult &Result) {<br>
- const CXXRecordDecl *MatchedDecl =<br>
- Result.Nodes.getNodeAs<<wbr>CXXRecordDecl>("class-def");<br>
+ const auto *MatchedDecl = Result.Nodes.getNodeAs<<wbr>CXXRecordDecl>("class-def");<br>
if (!MatchedDecl)<br>
return;<br>
<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>ExplicitConstructorCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/google/<wbr>ExplicitConstructorCheck.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>ExplicitConstructorCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>ExplicitConstructorCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -75,8 +75,7 @@ static bool isStdInitializerList(QualTyp<br>
}<br>
<br>
void ExplicitConstructorCheck::<wbr>check(const MatchFinder::MatchResult &Result) {<br>
- const CXXConstructorDecl *Ctor =<br>
- Result.Nodes.getNodeAs<<wbr>CXXConstructorDecl>("ctor");<br>
+ const auto *Ctor = Result.Nodes.getNodeAs<<wbr>CXXConstructorDecl>("ctor");<br>
// Do not be confused: isExplicit means 'explicit' keyword is present,<br>
// isImplicit means that it's a compiler-generated constructor.<br>
if (Ctor->isOutOfLine() || Ctor->isImplicit() || Ctor->isDeleted() ||<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>NonConstReferences.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/NonConstReferences.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/google/<wbr>NonConstReferences.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>NonConstReferences.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/google/<wbr>NonConstReferences.cpp Wed Dec 14 09:29:23 2016<br>
@@ -56,7 +56,7 @@ void NonConstReferences::check(<wbr>const Mat<br>
if (!Function->isCanonicalDecl())<br>
return;<br>
<br>
- if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(<wbr>Function)) {<br>
+ if (const auto *Method = dyn_cast<CXXMethodDecl>(<wbr>Function)) {<br>
// Don't warn on implementations of an interface using references.<br>
if (Method->begin_overridden_<wbr>methods() != Method->end_overridden_<wbr>methods())<br>
return;<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/llvm/TwineLocalCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/llvm/<wbr>TwineLocalCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/llvm/TwineLocalCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/llvm/TwineLocalCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -25,7 +25,7 @@ void TwineLocalCheck::<wbr>registerMatchers(M<br>
}<br>
<br>
void TwineLocalCheck::check(const MatchFinder::MatchResult &Result) {<br>
- const VarDecl *VD = Result.Nodes.getNodeAs<<wbr>VarDecl>("variable");<br>
+ const auto *VD = Result.Nodes.getNodeAs<<wbr>VarDecl>("variable");<br>
auto Diag = diag(VD->getLocation(),<br>
"twine variables are prone to use-after-free bugs");<br>
<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ArgumentCommentCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/misc/<wbr>ArgumentCommentCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ArgumentCommentCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ArgumentCommentCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -177,7 +177,7 @@ void ArgumentCommentCheck::<wbr>checkCallArgs<br>
}<br>
<br>
void ArgumentCommentCheck::check(<wbr>const MatchFinder::MatchResult &Result) {<br>
- const Expr *E = Result.Nodes.getNodeAs<Expr>("<wbr>expr");<br>
+ const auto *E = Result.Nodes.getNodeAs<Expr>("<wbr>expr");<br>
if (const auto *Call = dyn_cast<CallExpr>(E)) {<br>
const FunctionDecl *Callee = Call->getDirectCallee();<br>
if (!Callee)<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MoveForwardingReferenceCheck.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MoveForwardingReferenceCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/misc/<wbr>MoveForwardingReferenceCheck.<wbr>cpp?rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MoveForwardingReferenceCheck.<wbr>cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MoveForwardingReferenceCheck.<wbr>cpp Wed Dec 14 09:29:23 2016<br>
@@ -104,8 +104,7 @@ void MoveForwardingReferenceCheck::<wbr>check<br>
<br>
// Get the FunctionDecl and FunctionTemplateDecl containing the function<br>
// parameter.<br>
- const FunctionDecl *FuncForParam =<br>
- dyn_cast<FunctionDecl>(<wbr>ParmVar->getDeclContext());<br>
+ const auto *FuncForParam = dyn_cast<FunctionDecl>(<wbr>ParmVar->getDeclContext());<br>
if (!FuncForParam)<br>
return;<br>
const FunctionTemplateDecl *FuncTemplate =<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MultipleStatementMacroCheck.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MultipleStatementMacroCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/misc/<wbr>MultipleStatementMacroCheck.<wbr>cpp?rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MultipleStatementMacroCheck.<wbr>cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>MultipleStatementMacroCheck.<wbr>cpp Wed Dec 14 09:29:23 2016<br>
@@ -26,7 +26,7 @@ const Stmt *nextStmt(const MatchFinder::<br>
auto Parents = Result.Context->getParents(*S)<wbr>;<br>
if (Parents.empty())<br>
return nullptr;<br>
- const Stmt *Parent = Parents[0].get<Stmt>();<br>
+ const auto *Parent = Parents[0].get<Stmt>();<br>
if (!Parent)<br>
return nullptr;<br>
const Stmt *Prev = nullptr;<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ThrowByValueCatchByReferenceCh<wbr>eck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/misc/<wbr>ThrowByValueCatchByReferenceCh<wbr>eck.cpp?rev=289656&r1=289655&<wbr>r2=289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ThrowByValueCatchByReferenceCh<wbr>eck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/misc/<wbr>ThrowByValueCatchByReferenceCh<wbr>eck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -100,10 +100,8 @@ void ThrowByValueCatchByReferenceCh<wbr>eck::<br>
if (CheckAnonymousTemporaries) {<br>
bool emit = false;<br>
auto *currentSubExpr = subExpr->IgnoreImpCasts();<br>
- const DeclRefExpr *variableReference =<br>
- dyn_cast<DeclRefExpr>(<wbr>currentSubExpr);<br>
- const CXXConstructExpr *constructorCall =<br>
- dyn_cast<CXXConstructExpr>(<wbr>currentSubExpr);<br>
+ const auto *variableReference = dyn_cast<DeclRefExpr>(<wbr>currentSubExpr);<br>
+ const auto *constructorCall = dyn_cast<CXXConstructExpr>(<wbr>currentSubExpr);<br>
// If we have a DeclRefExpr, we flag for emitting a diagnosis message in<br>
// case the referenced variable is neither a function parameter nor a<br>
// variable declared in the catch statement.<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseNullptrCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/modernize/<wbr>UseNullptrCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseNullptrCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseNullptrCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -26,7 +26,7 @@ const char CastSequence[] = "sequence";<br>
<br>
AST_MATCHER(Type, sugaredNullptrType) {<br>
const Type *DesugaredType = Node.<wbr>getUnqualifiedDesugaredType();<br>
- if (const BuiltinType *BT = dyn_cast<BuiltinType>(<wbr>DesugaredType))<br>
+ if (const auto *BT = dyn_cast<BuiltinType>(<wbr>DesugaredType))<br>
return BT->getKind() == BuiltinType::NullPtr;<br>
return false;<br>
}<br>
@@ -188,7 +188,7 @@ public:<br>
// Only VisitStmt is overridden as we shouldn't find other base AST types<br>
// within a cast expression.<br>
bool VisitStmt(Stmt *S) {<br>
- CastExpr *C = dyn_cast<CastExpr>(S);<br>
+ auto *C = dyn_cast<CastExpr>(S);<br>
// Catch the castExpr inside cxxDefaultArgExpr.<br>
if (auto *E = dyn_cast<CXXDefaultArgExpr>(S)<wbr>)<br>
C = dyn_cast<CastExpr>(E->getExpr(<wbr>));<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseOverrideCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/modernize/<wbr>UseOverrideCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseOverrideCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/modernize/<wbr>UseOverrideCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -60,7 +60,7 @@ static StringRef GetText(const Token &To<br>
}<br>
<br>
void UseOverrideCheck::check(const MatchFinder::MatchResult &Result) {<br>
- const FunctionDecl *Method = Result.Nodes.getNodeAs<<wbr>FunctionDecl>("method");<br>
+ const auto *Method = Result.Nodes.getNodeAs<<wbr>FunctionDecl>("method");<br>
const SourceManager &Sources = *Result.SourceManager;<br>
<br>
assert(Method != nullptr);<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/mpi/TypeMismatchCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/mpi/<wbr>TypeMismatchCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/mpi/TypeMismatchCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/mpi/TypeMismatchCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -243,7 +243,7 @@ void TypeMismatchCheck::<wbr>registerMatchers<br>
<br>
void TypeMismatchCheck::check(const MatchFinder::MatchResult &Result) {<br>
static ento::mpi::<wbr>MPIFunctionClassifier FuncClassifier(*Result.<wbr>Context);<br>
- const CallExpr *const CE = Result.Nodes.getNodeAs<<wbr>CallExpr>("CE");<br>
+ const auto *const CE = Result.Nodes.getNodeAs<<wbr>CallExpr>("CE");<br>
if (!CE->getDirectCallee())<br>
return;<br>
<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>ImplicitBoolCastCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/readability/<wbr>ImplicitBoolCastCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>ImplicitBoolCastCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>ImplicitBoolCastCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -102,7 +102,7 @@ bool areParensNeededForOverloadedOp<wbr>erato<br>
}<br>
<br>
bool areParensNeededForStatement(<wbr>const Stmt *Statement) {<br>
- if (const CXXOperatorCallExpr *OverloadedOperatorCall =<br>
+ if (const auto *OverloadedOperatorCall =<br>
llvm::dyn_cast<<wbr>CXXOperatorCallExpr>(<wbr>Statement)) {<br>
return areParensNeededForOverloadedOp<wbr>erator(<br>
OverloadedOperatorCall-><wbr>getOperator());<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>NamespaceCommentCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/readability/<wbr>NamespaceCommentCheck.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>NamespaceCommentCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>NamespaceCommentCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -57,7 +57,7 @@ static std::string getNamespaceComment(c<br>
}<br>
<br>
void NamespaceCommentCheck::check(<wbr>const MatchFinder::MatchResult &Result) {<br>
- const NamespaceDecl *ND = Result.Nodes.getNodeAs<<wbr>NamespaceDecl>("namespace");<br>
+ const auto *ND = Result.Nodes.getNodeAs<<wbr>NamespaceDecl>("namespace");<br>
const SourceManager &Sources = *Result.SourceManager;<br>
<br>
if (!locationsInSameFile(Sources, ND->getLocStart(), ND->getRBraceLoc()))<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantDeclarationCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/readability/<wbr>RedundantDeclarationCheck.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantDeclarationCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantDeclarationCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -24,7 +24,7 @@ void RedundantDeclarationCheck::<wbr>register<br>
}<br>
<br>
void RedundantDeclarationCheck::<wbr>check(const MatchFinder::MatchResult &Result) {<br>
- const NamedDecl *D = Result.Nodes.getNodeAs<<wbr>NamedDecl>("Decl");<br>
+ const auto *D = Result.Nodes.getNodeAs<<wbr>NamedDecl>("Decl");<br>
const auto *Prev = D->getPreviousDecl();<br>
if (!Prev)<br>
return;<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantSmartptrGetCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/readability/<wbr>RedundantSmartptrGetCheck.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantSmartptrGetCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/readability/<wbr>RedundantSmartptrGetCheck.cpp Wed Dec 14 09:29:23 2016<br>
@@ -116,8 +116,8 @@ void RedundantSmartptrGetCheck::<wbr>check(co<br>
<br>
bool IsPtrToPtr = Result.Nodes.getNodeAs<Decl>("<wbr>ptr_to_ptr") != nullptr;<br>
bool IsMemberExpr = Result.Nodes.getNodeAs<Expr>("<wbr>memberExpr") != nullptr;<br>
- const Expr *GetCall = Result.Nodes.getNodeAs<Expr>("<wbr>redundant_get");<br>
- const Expr *Smartptr = Result.Nodes.getNodeAs<Expr>("<wbr>smart_pointer");<br>
+ const auto *GetCall = Result.Nodes.getNodeAs<Expr>("<wbr>redundant_get");<br>
+ const auto *Smartptr = Result.Nodes.getNodeAs<Expr>("<wbr>smart_pointer");<br>
<br>
if (IsPtrToPtr && IsMemberExpr) {<br>
// Ignore this case (eg. Foo->get()->DoSomething());<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>include-fixer/find-all-<wbr>symbols/FindAllSymbols.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/find-all-symbols/FindAllSymbols.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/include-fixer/find-all-<wbr>symbols/FindAllSymbols.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>include-fixer/find-all-<wbr>symbols/FindAllSymbols.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>include-fixer/find-all-<wbr>symbols/FindAllSymbols.cpp Wed Dec 14 09:29:23 2016<br>
@@ -211,7 +211,7 @@ void FindAllSymbols::run(const MatchFind<br>
return;<br>
}<br>
<br>
- const NamedDecl *ND = Result.Nodes.getNodeAs<<wbr>NamedDecl>("decl");<br>
+ const auto *ND = Result.Nodes.getNodeAs<<wbr>NamedDecl>("decl");<br>
assert(ND && "Matched declaration must be a NamedDecl!");<br>
const SourceManager *SM = Result.SourceManager;<br>
<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>modularize/CoverageChecker.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/CoverageChecker.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/modularize/<wbr>CoverageChecker.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>modularize/CoverageChecker.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>modularize/CoverageChecker.cpp Wed Dec 14 09:29:23 2016<br>
@@ -225,9 +225,8 @@ bool CoverageChecker::<wbr>collectModuleHeade<br>
ModuleMapHeadersSet.insert(<wbr>ModularizeUtilities::<wbr>getCanonicalPath(<br>
Header.Entry->getName()));<br>
<br>
- for (Module::submodule_const_<wbr>iterator MI = Mod.submodule_begin(),<br>
- MIEnd = Mod.submodule_end();<br>
- MI != MIEnd; ++MI)<br>
+ for (auto MI = Mod.submodule_begin(), MIEnd = Mod.submodule_end();<br>
+ MI != MIEnd; ++MI)<br>
collectModuleHeaders(**MI);<br>
<br>
return true;<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>modularize/Modularize.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/modularize/Modularize.<wbr>cpp?rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>modularize/Modularize.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>modularize/Modularize.cpp Wed Dec 14 09:29:23 2016<br>
@@ -341,9 +341,7 @@ static std::string findInputFile(const C<br>
const unsigned IncludedFlagsBitmask = options::CC1Option;<br>
unsigned MissingArgIndex, MissingArgCount;<br>
SmallVector<const char *, 256> Argv;<br>
- for (CommandLineArguments::const_<wbr>iterator I = CLArgs.begin(),<br>
- E = CLArgs.end();<br>
- I != E; ++I)<br>
+ for (auto I = CLArgs.begin(), E = CLArgs.end(); I != E; ++I)<br>
Argv.push_back(I->c_str());<br>
InputArgList Args = Opts->ParseArgs(Argv, MissingArgIndex, MissingArgCount,<br>
IncludedFlagsBitmask);<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>modularize/<wbr>ModularizeUtilities.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/ModularizeUtilities.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/modularize/<wbr>ModularizeUtilities.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>modularize/<wbr>ModularizeUtilities.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>modularize/<wbr>ModularizeUtilities.cpp Wed Dec 14 09:29:23 2016<br>
@@ -77,7 +77,7 @@ ModularizeUtilities *ModularizeUtilities<br>
std::error_code ModularizeUtilities::<wbr>loadAllHeaderListsAndDependenc<wbr>ies() {<br>
typedef std::vector<std::string>::<wbr>iterator Iter;<br>
// For each input file.<br>
- for (Iter I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E; ++I) {<br>
+ for (auto I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E; ++I) {<br>
llvm::StringRef InputPath = *I;<br>
// If it's a module map.<br>
if (InputPath.endswith(".<wbr>modulemap")) {<br>
@@ -345,9 +345,8 @@ bool ModularizeUtilities::<wbr>collectModuleH<br>
DependentsVector UmbrellaDependents;<br>
<br>
// Recursively do submodules.<br>
- for (clang::Module::submodule_<wbr>const_iterator MI = Mod.submodule_begin(),<br>
- MIEnd = Mod.submodule_end();<br>
- MI != MIEnd; ++MI)<br>
+ for (auto MI = Mod.submodule_begin(), MIEnd = Mod.submodule_end();<br>
+ MI != MIEnd; ++MI)<br>
collectModuleHeaders(**MI);<br>
<br>
if (const FileEntry *UmbrellaHeader = Mod.getUmbrellaHeader().Entry) {<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>modularize/ModuleAssistant.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/ModuleAssistant.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/modularize/<wbr>ModuleAssistant.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>modularize/ModuleAssistant.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>modularize/ModuleAssistant.cpp Wed Dec 14 09:29:23 2016<br>
@@ -87,17 +87,14 @@ bool Module::output(llvm::raw_fd_<wbr>ostream<br>
}<br>
<br>
// Output submodules.<br>
- for (std::vector<Module *>::iterator I = SubModules.begin(),<br>
- E = SubModules.end();<br>
- I != E; ++I) {<br>
+ for (auto I = SubModules.begin(), E = SubModules.end(); I != E; ++I) {<br>
if (!(*I)->output(OS, Indent))<br>
return false;<br>
}<br>
<br>
// Output header files.<br>
- for (std::vector<std::string>::<wbr>iterator I = HeaderFileNames.begin(),<br>
- E = HeaderFileNames.end();<br>
- I != E; ++I) {<br>
+ for (auto I = HeaderFileNames.begin(), E = HeaderFileNames.end(); I != E;<br>
+ ++I) {<br>
OS.indent(Indent);<br>
if (IsProblem || strstr((*I).c_str(), ".inl"))<br>
OS << "exclude header \"" << *I << "\"\n";<br>
@@ -123,9 +120,7 @@ bool Module::output(llvm::raw_fd_<wbr>ostream<br>
<br>
// Lookup a sub-module.<br>
Module *Module::findSubModule(llvm::<wbr>StringRef SubName) {<br>
- for (std::vector<Module *>::iterator I = SubModules.begin(),<br>
- E = SubModules.end();<br>
- I != E; ++I) {<br>
+ for (auto I = SubModules.begin(), E = SubModules.end(); I != E; ++I) {<br>
if ((*I)->Name == SubName)<br>
return *I;<br>
}<br>
@@ -227,7 +222,7 @@ static Module *loadModuleDescriptions(<br>
DependencyMap &Dependencies, llvm::StringRef HeaderPrefix) {<br>
<br>
// Create root module.<br>
- Module *RootModule = new Module(RootModuleName, false);<br>
+ auto *RootModule = new Module(RootModuleName, false);<br>
<br>
llvm::SmallString<256> CurrentDirectory;<br>
llvm::sys::fs::current_path(<wbr>CurrentDirectory);<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>modularize/<wbr>PreprocessorTracker.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/modularize/<wbr>PreprocessorTracker.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>modularize/<wbr>PreprocessorTracker.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>modularize/<wbr>PreprocessorTracker.cpp Wed Dec 14 09:29:23 2016<br>
@@ -558,9 +558,7 @@ public:<br>
// Check for the presence of a header inclusion path handle entry.<br>
// Return false if not found.<br>
bool haveInclusionPathHandle(<wbr>InclusionPathHandle H) {<br>
- for (std::vector<<wbr>InclusionPathHandle>::iterator<br>
- I = InclusionPathHandles.begin(),<br>
- E = InclusionPathHandles.end();<br>
+ for (auto I = InclusionPathHandles.begin(), E = InclusionPathHandles.end();<br>
I != E; ++I) {<br>
if (*I == H)<br>
return true;<br>
@@ -608,9 +606,8 @@ public:<br>
MacroExpansionInstance *<br>
findMacroExpansionInstance(<wbr>StringHandle MacroExpanded,<br>
PPItemKey &DefinitionLocation) {<br>
- for (std::vector<<wbr>MacroExpansionInstance>::<wbr>iterator<br>
- I = MacroExpansionInstances.begin(<wbr>),<br>
- E = MacroExpansionInstances.end();<br>
+ for (auto I = MacroExpansionInstances.begin(<wbr>),<br>
+ E = MacroExpansionInstances.end();<br>
I != E; ++I) {<br>
if ((I->MacroExpanded == MacroExpanded) &&<br>
(I->DefinitionLocation == DefinitionLocation)) {<br>
@@ -659,9 +656,7 @@ public:<br>
// Check for the presence of a header inclusion path handle entry.<br>
// Return false if not found.<br>
bool haveInclusionPathHandle(<wbr>InclusionPathHandle H) {<br>
- for (std::vector<<wbr>InclusionPathHandle>::iterator<br>
- I = InclusionPathHandles.begin(),<br>
- E = InclusionPathHandles.end();<br>
+ for (auto I = InclusionPathHandles.begin(), E = InclusionPathHandles.end();<br>
I != E; ++I) {<br>
if (*I == H)<br>
return true;<br>
@@ -701,9 +696,8 @@ public:<br>
// Find a matching condition expansion instance.<br>
ConditionalExpansionInstance *<br>
findConditionalExpansionInstan<wbr>ce(clang::PPCallbacks::<wbr>ConditionValueKind ConditionValue) {<br>
- for (std::vector<<wbr>ConditionalExpansionInstance>:<wbr>:iterator<br>
- I = ConditionalExpansionInstances.<wbr>begin(),<br>
- E = ConditionalExpansionInstances.<wbr>end();<br>
+ for (auto I = ConditionalExpansionInstances.<wbr>begin(),<br>
+ E = ConditionalExpansionInstances.<wbr>end();<br>
I != E; ++I) {<br>
if (I->ConditionValue == ConditionValue) {<br>
return &*I; // Found.<br>
@@ -954,9 +948,8 @@ public:<br>
HeaderHandle findHeaderHandle(llvm::<wbr>StringRef HeaderPath) const {<br>
std::string CanonicalPath = getCanonicalPath(HeaderPath);<br>
HeaderHandle H = 0;<br>
- for (std::vector<StringHandle>::<wbr>const_iterator I = HeaderPaths.begin(),<br>
- E = HeaderPaths.end();<br>
- I != E; ++I, ++H) {<br>
+ for (auto I = HeaderPaths.begin(), E = HeaderPaths.end(); I != E;<br>
+ ++I, ++H) {<br>
if (**I == CanonicalPath)<br>
return H;<br>
}<br>
@@ -1004,9 +997,7 @@ public:<br>
<br>
// Check for presence of header handle in the header stack.<br>
bool isHeaderHandleInStack(<wbr>HeaderHandle H) const {<br>
- for (std::vector<HeaderHandle>::<wbr>const_iterator I = HeaderStack.begin(),<br>
- E = HeaderStack.end();<br>
- I != E; ++I) {<br>
+ for (auto I = HeaderStack.begin(), E = HeaderStack.end(); I != E; ++I) {<br>
if (*I == H)<br>
return true;<br>
}<br>
@@ -1018,10 +1009,8 @@ public:<br>
InclusionPathHandle<br>
findInclusionPathHandle(const std::vector<HeaderHandle> &Path) const {<br>
InclusionPathHandle H = 0;<br>
- for (std::vector<<wbr>HeaderInclusionPath>::const_<wbr>iterator<br>
- I = InclusionPaths.begin(),<br>
- E = InclusionPaths.end();<br>
- I != E; ++I, ++H) {<br>
+ for (auto I = InclusionPaths.begin(), E = InclusionPaths.end(); I != E;<br>
+ ++I, ++H) {<br>
if (I->Path == Path)<br>
return H;<br>
}<br>
@@ -1065,7 +1054,7 @@ public:<br>
StringHandle MacroName = addString(II->getName());<br>
PPItemKey InstanceKey(PP, MacroName, H, InstanceLoc);<br>
PPItemKey DefinitionKey(PP, MacroName, H, DefinitionLoc);<br>
- MacroExpansionMapIter I = MacroExpansions.find(<wbr>InstanceKey);<br>
+ auto I = MacroExpansions.find(<wbr>InstanceKey);<br>
// If existing instance of expansion not found, add one.<br>
if (I == MacroExpansions.end()) {<br>
std::string InstanceSourceLine =<br>
@@ -1113,7 +1102,7 @@ public:<br>
return;<br>
StringHandle ConditionUnexpandedHandle(<wbr>addString(ConditionUnexpanded)<wbr>);<br>
PPItemKey InstanceKey(PP, ConditionUnexpandedHandle, H, InstanceLoc);<br>
- ConditionalExpansionMapIter I = ConditionalExpansions.find(<wbr>InstanceKey);<br>
+ auto I = ConditionalExpansions.find(<wbr>InstanceKey);<br>
// If existing instance of condition not found, add one.<br>
if (I == ConditionalExpansions.end()) {<br>
std::string InstanceSourceLine =<br>
@@ -1144,9 +1133,8 @@ public:<br>
bool reportInconsistentMacros(llvm:<wbr>:raw_ostream &OS) override {<br>
bool ReturnValue = false;<br>
// Walk all the macro expansion trackers in the map.<br>
- for (MacroExpansionMapIter I = MacroExpansions.begin(),<br>
- E = MacroExpansions.end();<br>
- I != E; ++I) {<br>
+ for (auto I = MacroExpansions.begin(), E = MacroExpansions.end(); I != E;<br>
+ ++I) {<br>
const PPItemKey &ItemKey = I->first;<br>
MacroExpansionTracker &MacroExpTracker = I->second;<br>
// If no mismatch (only one instance value) continue.<br>
@@ -1162,21 +1150,19 @@ public:<br>
<< "' has different values in this header, depending on how it was "<br>
"included.\n";<br>
// Walk all the instances.<br>
- for (std::vector<<wbr>MacroExpansionInstance>::<wbr>iterator<br>
- IMT = MacroExpTracker.<wbr>MacroExpansionInstances.begin(<wbr>),<br>
- EMT = MacroExpTracker.<wbr>MacroExpansionInstances.end();<br>
+ for (auto IMT = MacroExpTracker.<wbr>MacroExpansionInstances.begin(<wbr>),<br>
+ EMT = MacroExpTracker.<wbr>MacroExpansionInstances.end();<br>
IMT != EMT; ++IMT) {<br>
MacroExpansionInstance &MacroInfo = *IMT;<br>
OS << " '" << *MacroExpTracker.<wbr>MacroUnexpanded << "' expanded to: '"<br>
<< *MacroInfo.MacroExpanded<br>
<< "' with respect to these inclusion paths:\n";<br>
// Walk all the inclusion path hierarchies.<br>
- for (std::vector<<wbr>InclusionPathHandle>::iterator<br>
- IIP = MacroInfo.<wbr>InclusionPathHandles.begin(),<br>
- EIP = MacroInfo.<wbr>InclusionPathHandles.end();<br>
+ for (auto IIP = MacroInfo.<wbr>InclusionPathHandles.begin(),<br>
+ EIP = MacroInfo.<wbr>InclusionPathHandles.end();<br>
IIP != EIP; ++IIP) {<br>
const std::vector<HeaderHandle> &ip = getInclusionPath(*IIP);<br>
- int Count = (int)ip.size();<br>
+ auto Count = (int)ip.size();<br>
for (int Index = 0; Index < Count; ++Index) {<br>
HeaderHandle H = ip[Index];<br>
OS << std::string((Index * 2) + 4, ' ') << *getHeaderFilePath(H)<br>
@@ -1205,8 +1191,8 @@ public:<br>
bool reportInconsistentConditionals<wbr>(llvm::raw_ostream &OS) override {<br>
bool ReturnValue = false;<br>
// Walk all the conditional trackers in the map.<br>
- for (ConditionalExpansionMapIter I = ConditionalExpansions.begin(),<br>
- E = ConditionalExpansions.end();<br>
+ for (auto I = ConditionalExpansions.begin(),<br>
+ E = ConditionalExpansions.end();<br>
I != E; ++I) {<br>
const PPItemKey &ItemKey = I->first;<br>
ConditionalTracker &CondTracker = I->second;<br>
@@ -1225,21 +1211,19 @@ public:<br>
<< "' has different values in this header, depending on how it was "<br>
"included.\n";<br>
// Walk all the instances.<br>
- for (std::vector<<wbr>ConditionalExpansionInstance>:<wbr>:iterator<br>
- IMT = CondTracker.<wbr>ConditionalExpansionInstances.<wbr>begin(),<br>
- EMT = CondTracker.<wbr>ConditionalExpansionInstances.<wbr>end();<br>
+ for (auto IMT = CondTracker.<wbr>ConditionalExpansionInstances.<wbr>begin(),<br>
+ EMT = CondTracker.<wbr>ConditionalExpansionInstances.<wbr>end();<br>
IMT != EMT; ++IMT) {<br>
ConditionalExpansionInstance &MacroInfo = *IMT;<br>
OS << " '" << *CondTracker.<wbr>ConditionUnexpanded << "' expanded to: '"<br>
<< ConditionValueKindStrings[<wbr>MacroInfo.ConditionValue]<br>
<< "' with respect to these inclusion paths:\n";<br>
// Walk all the inclusion path hierarchies.<br>
- for (std::vector<<wbr>InclusionPathHandle>::iterator<br>
- IIP = MacroInfo.<wbr>InclusionPathHandles.begin(),<br>
- EIP = MacroInfo.<wbr>InclusionPathHandles.end();<br>
+ for (auto IIP = MacroInfo.<wbr>InclusionPathHandles.begin(),<br>
+ EIP = MacroInfo.<wbr>InclusionPathHandles.end();<br>
IIP != EIP; ++IIP) {<br>
const std::vector<HeaderHandle> &ip = getInclusionPath(*IIP);<br>
- int Count = (int)ip.size();<br>
+ auto Count = (int)ip.size();<br>
for (int Index = 0; Index < Count; ++Index) {<br>
HeaderHandle H = ip[Index];<br>
OS << std::string((Index * 2) + 4, ' ') << *getHeaderFilePath(H)<br>
<br>
Modified: clang-tools-extra/trunk/pp-<wbr>trace/PPTrace.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPTrace.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/pp-trace/PPTrace.cpp?<wbr>rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/pp-<wbr>trace/PPTrace.cpp (original)<br>
+++ clang-tools-extra/trunk/pp-<wbr>trace/PPTrace.cpp Wed Dec 14 09:29:23 2016<br>
@@ -161,8 +161,7 @@ static int outputPPTrace(std::vector<Cal<br>
const CallbackCall &Callback = *I;<br>
OS << "- Callback: " << Callback.Name << "\n";<br>
<br>
- for (std::vector<Argument>::const_<wbr>iterator AI = Callback.Arguments.begin(),<br>
- AE = Callback.Arguments.end();<br>
+ for (auto AI = Callback.Arguments.begin(), AE = Callback.Arguments.end();<br>
AI != AE; ++AI) {<br>
const Argument &Arg = *AI;<br>
OS << " " << Arg.Name << ": " << Arg.Value << "\n";<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>ClangTidyDiagnosticConsumerTes<wbr>t.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/unittests/clang-tidy/<wbr>ClangTidyDiagnosticConsumerTes<wbr>t.cpp?rev=289656&r1=289655&r2=<wbr>289656&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>ClangTidyDiagnosticConsumerTes<wbr>t.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>ClangTidyDiagnosticConsumerTes<wbr>t.cpp Wed Dec 14 09:29:23 2016<br>
@@ -14,7 +14,7 @@ public:<br>
Finder->addMatcher(ast_<wbr>matchers::varDecl().bind("var"<wbr>), this);<br>
}<br>
void check(const ast_matchers::MatchFinder::<wbr>MatchResult &Result) override {<br>
- const VarDecl *Var = Result.Nodes.getNodeAs<<wbr>VarDecl>("var");<br>
+ const auto *Var = Result.Nodes.getNodeAs<<wbr>VarDecl>("var");<br>
// Add diagnostics in the wrong order.<br>
diag(Var->getLocation(), "variable");<br>
diag(Var->getTypeSpecStartLoc(<wbr>), "type specifier");<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>NamespaceAliaserTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/unittests/clang-tidy/<wbr>NamespaceAliaserTest.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>NamespaceAliaserTest.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>NamespaceAliaserTest.cpp Wed Dec 14 09:29:23 2016<br>
@@ -31,8 +31,7 @@ public:<br>
if (!Aliaser)<br>
Aliaser.reset(new NamespaceAliaser(*Result.<wbr>SourceManager));<br>
<br>
- const CallExpr *Call =<br>
- Result.Nodes.getNodeAs<<wbr>CallExpr>("foo");<br>
+ const auto *Call = Result.Nodes.getNodeAs<<wbr>CallExpr>("foo");<br>
assert(Call != nullptr && "Did not find node \"foo\"");<br>
auto Hint = Aliaser->createAlias(*Result.<wbr>Context, *Call, "::foo::bar",<br>
{"b", "some_alias"});<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>UsingInserterTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp?rev=289656&r1=289655&r2=289656&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/unittests/clang-tidy/<wbr>UsingInserterTest.cpp?rev=<wbr>289656&r1=289655&r2=289656&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>UsingInserterTest.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>unittests/clang-tidy/<wbr>UsingInserterTest.cpp Wed Dec 14 09:29:23 2016<br>
@@ -33,8 +33,7 @@ public:<br>
if (!Inserter)<br>
Inserter.reset(new UsingInserter(*Result.<wbr>SourceManager));<br>
<br>
- const clang::CallExpr *Call =<br>
- Result.Nodes.getNodeAs<clang::<wbr>CallExpr>("foo");<br>
+ const auto *Call = Result.Nodes.getNodeAs<clang::<wbr>CallExpr>("foo");<br>
assert(Call != nullptr && "Did not find node \"foo\"");<br>
auto Hint =<br>
Inserter-><wbr>createUsingDeclaration(*<wbr>Result.Context, *Call, "::foo::func");<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>