<div dir="ltr">Thanks for all the cleanup work!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 6, 2021 at 9:10 AM Kazu Hirata via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Kazu Hirata<br>
Date: 2021-09-06T09:10:07-07:00<br>
New Revision: 3322354bfcae4ce03675f7597e68d99243d63f69<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/3322354bfcae4ce03675f7597e68d99243d63f69" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/3322354bfcae4ce03675f7597e68d99243d63f69</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/3322354bfcae4ce03675f7597e68d99243d63f69.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/3322354bfcae4ce03675f7597e68d99243d63f69.diff</a><br>
<br>
LOG: [Support] Qualify auto (NFC)<br>
<br>
Identified with readability-qualified-auto.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/include/llvm/Support/Allocator.h<br>
    llvm/include/llvm/Support/Error.h<br>
    llvm/include/llvm/Support/FormatVariadic.h<br>
    llvm/include/llvm/Support/YAMLTraits.h<br>
    llvm/lib/Support/SpecialCaseList.cpp<br>
    llvm/lib/Support/TimeProfiler.cpp<br>
    llvm/lib/Support/VirtualFileSystem.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h<br>
index 245432debce6..9e8ce4e36197 100644<br>
--- a/llvm/include/llvm/Support/Allocator.h<br>
+++ b/llvm/include/llvm/Support/Allocator.h<br>
@@ -277,7 +277,7 @@ class BumpPtrAllocatorImpl<br>
     size_t TotalMemory = 0;<br>
     for (auto I = Slabs.begin(), E = Slabs.end(); I != E; ++I)<br>
       TotalMemory += computeSlabSize(std::distance(Slabs.begin(), I));<br>
-    for (auto &PtrAndSize : CustomSizedSlabs)<br>
+    for (const auto &PtrAndSize : CustomSizedSlabs)<br>
       TotalMemory += PtrAndSize.second;<br>
     return TotalMemory;<br>
   }<br>
<br>
diff  --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h<br>
index 4708d5bd6d57..707e0b98b900 100644<br>
--- a/llvm/include/llvm/Support/Error.h<br>
+++ b/llvm/include/llvm/Support/Error.h<br>
@@ -313,7 +313,7 @@ class LLVM_NODISCARD Error {<br>
   }<br>
<br>
   friend raw_ostream &operator<<(raw_ostream &OS, const Error &E) {<br>
-    if (auto P = E.getPtr())<br>
+    if (auto *P = E.getPtr())<br>
       P->log(OS);<br>
     else<br>
       OS << "success";<br>
@@ -373,7 +373,7 @@ class ErrorList final : public ErrorInfo<ErrorList> {<br>
 public:<br>
   void log(raw_ostream &OS) const override {<br>
     OS << "Multiple errors:\n";<br>
-    for (auto &ErrPayload : Payloads) {<br>
+    for (const auto &ErrPayload : Payloads) {<br>
       ErrPayload->log(OS);<br>
       OS << "\n";<br>
     }<br>
<br>
diff  --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h<br>
index 094b054f773f..89575f01b717 100644<br>
--- a/llvm/include/llvm/Support/FormatVariadic.h<br>
+++ b/llvm/include/llvm/Support/FormatVariadic.h<br>
@@ -94,7 +94,7 @@ class formatv_object_base {<br>
         continue;<br>
       }<br>
<br>
-      auto W = Adapters[R.Index];<br>
+      auto *W = Adapters[R.Index];<br>
<br>
       FmtAlign Align(*W, R.Where, R.Align, R.Pad);<br>
       Align.format(S, R.Options);<br>
<br>
diff  --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h<br>
index 9ac9eb300983..bea232e6e000 100644<br>
--- a/llvm/include/llvm/Support/YAMLTraits.h<br>
+++ b/llvm/include/llvm/Support/YAMLTraits.h<br>
@@ -1641,7 +1641,7 @@ void IO::processKeyWithDefault(const char *Key, Optional<T> &Val,<br>
     // usually None.<br>
     bool IsNone = false;<br>
     if (!outputting())<br>
-      if (auto *Node = dyn_cast<ScalarNode>(((Input *)this)->getCurrentNode()))<br>
+      if (const auto *Node = dyn_cast<ScalarNode>(((Input *)this)->getCurrentNode()))<br>
         // We use rtrim to ignore possible white spaces that might exist when a<br>
         // comment is present on the same line.<br>
         IsNone = Node->getRawValue().rtrim(' ') == "<none>";<br>
<br>
diff  --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp<br>
index 73f852624a69..499e5aaacdac 100644<br>
--- a/llvm/lib/Support/SpecialCaseList.cpp<br>
+++ b/llvm/lib/Support/SpecialCaseList.cpp<br>
@@ -64,7 +64,7 @@ unsigned SpecialCaseList::Matcher::match(StringRef Query) const {<br>
     return It->second;<br>
   if (Trigrams.isDefinitelyOut(Query))<br>
     return false;<br>
-  for (auto& RegExKV : RegExes)<br>
+  for (const auto &RegExKV : RegExes)<br>
     if (RegExKV.first->match(Query))<br>
       return RegExKV.second;<br>
   return 0;<br>
@@ -209,7 +209,7 @@ bool SpecialCaseList::inSection(StringRef Section, StringRef Prefix,<br>
 unsigned SpecialCaseList::inSectionBlame(StringRef Section, StringRef Prefix,<br>
                                          StringRef Query,<br>
                                          StringRef Category) const {<br>
-  for (auto &SectionIter : Sections)<br>
+  for (const auto &SectionIter : Sections)<br>
     if (SectionIter.SectionMatcher->match(Section)) {<br>
       unsigned Blame =<br>
           inSectionBlame(SectionIter.Entries, Prefix, Query, Category);<br>
<br>
diff  --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp<br>
index 8f2544e9e26d..1574212a0df0 100644<br>
--- a/llvm/lib/Support/TimeProfiler.cpp<br>
+++ b/llvm/lib/Support/TimeProfiler.cpp<br>
@@ -273,7 +273,7 @@ void llvm::timeTraceProfilerInitialize(unsigned TimeTraceGranularity,<br>
 void llvm::timeTraceProfilerCleanup() {<br>
   delete TimeTraceProfilerInstance;<br>
   std::lock_guard<std::mutex> Lock(Mu);<br>
-  for (auto TTP : *ThreadTimeTraceProfilerInstances)<br>
+  for (auto *TTP : *ThreadTimeTraceProfilerInstances)<br>
     delete TTP;<br>
   ThreadTimeTraceProfilerInstances->clear();<br>
 }<br>
<br>
diff  --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp<br>
index 15bb54e61817..ac54ff8ce168 100644<br>
--- a/llvm/lib/Support/VirtualFileSystem.cpp<br>
+++ b/llvm/lib/Support/VirtualFileSystem.cpp<br>
@@ -442,7 +442,7 @@ std::error_code OverlayFileSystem::isLocal(const Twine &Path, bool &Result) {<br>
 std::error_code<br>
 OverlayFileSystem::getRealPath(const Twine &Path,<br>
                                SmallVectorImpl<char> &Output) const {<br>
-  for (auto &FS : FSList)<br>
+  for (const auto &FS : FSList)<br>
     if (FS->exists(Path))<br>
       return FS->getRealPath(Path, Output);<br>
   return errc::no_such_file_or_directory;<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>