[PATCH] D79872: [MachineVerifier] Use the for Range loop to instead llvm::any_of

Zhang Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 20:07:22 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGaedb6615a8d0: [MachineVerifier] Use the for_range loop to instead llvm::any_of (authored by ZhangKang).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79872/new/

https://reviews.llvm.org/D79872

Files:
  llvm/lib/CodeGen/MachineVerifier.cpp


Index: llvm/lib/CodeGen/MachineVerifier.cpp
===================================================================
--- llvm/lib/CodeGen/MachineVerifier.cpp
+++ llvm/lib/CodeGen/MachineVerifier.cpp
@@ -168,14 +168,18 @@
 
       // Same for a full set.
       bool addRequired(const RegSet &RS) {
-        return llvm::any_of(
-            RS, [this](unsigned Reg) { return this->addRequired(Reg); });
+        bool Changed = false;
+        for (unsigned Reg : RS)
+          Changed |= addRequired(Reg);
+        return Changed;
       }
 
       // Same for a full map.
       bool addRequired(const RegMap &RM) {
-        return llvm::any_of(
-            RM, [this](const auto &P) { return this->addRequired(P.first); });
+        bool Changed = false;
+        for (const auto &I : RM)
+          Changed |= addRequired(I.first);
+        return Changed;
       }
 
       // Live-out registers are either in regsLiveOut or vregsPassed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79872.264146.patch
Type: text/x-patch
Size: 939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200515/df3ad082/attachment.bin>


More information about the llvm-commits mailing list