<div dir="ltr">While you're at it can you remove the any_of_range from tools/llvm-pdbdump/LinePrinter.cpp and use this new version instead?</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 29, 2015 at 5:27 PM, Sanjoy Das via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-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">sanjoy created this revision.<br>
sanjoy added reviewers: dblaikie, pcc.<br>
sanjoy added a subscriber: llvm-commits.<br>
<br>
<a href="http://reviews.llvm.org/D15063" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15063</a><br>
<br>
Files:<br>
  include/llvm/ADT/STLExtras.h<br>
  lib/Analysis/ScalarEvolution.cpp<br>
<br>
Index: lib/Analysis/ScalarEvolution.cpp<br>
===================================================================<br>
--- lib/Analysis/ScalarEvolution.cpp<br>
+++ lib/Analysis/ScalarEvolution.cpp<br>
@@ -8403,8 +8403,7 @@<br>
<br>
   // The only time we can solve this is when we have all constant indices.<br>
   // Otherwise, we cannot determine the overflow conditions.<br>
-  if (std::any_of(op_begin(), op_end(),<br>
-                  [](const SCEV *Op) { return !isa<SCEVConstant>(Op);}))<br>
+  if (any_of(operands(), [](const SCEV *Op) { return !isa<SCEVConstant>(Op); }))<br>
     return SE.getCouldNotCompute();<br>
<br>
   // Okay at this point we know that all elements of the chrec are constants and<br>
@@ -9694,8 +9693,8 @@<br>
     return false;<br>
   auto &SCEVPreds = ScevPredsIt->second;<br>
<br>
-  return std::any_of(SCEVPreds.begin(), SCEVPreds.end(),<br>
-                     [N](const SCEVPredicate *I) { return I->implies(N); });<br>
+  return any_of(SCEVPreds,<br>
+                [N](const SCEVPredicate *I) { return I->implies(N); });<br>
 }<br>
<br>
 const SCEV *SCEVUnionPredicate::getExpr() const { return nullptr; }<br>
Index: include/llvm/ADT/STLExtras.h<br>
===================================================================<br>
--- include/llvm/ADT/STLExtras.h<br>
+++ include/llvm/ADT/STLExtras.h<br>
@@ -371,6 +371,14 @@<br>
                      std::forward<UnaryPredicate>(P));<br>
 }<br>
<br>
+/// Provide wrappers to std::any_of which take ranges instead of having to pass<br>
+/// begin/end explicitly.<br>
+template <typename R, class UnaryPredicate><br>
+bool any_of(R &&Range, UnaryPredicate &&P) {<br>
+  return std::any_of(Range.begin(), Range.end(),<br>
+                     std::forward<UnaryPredicate>(P));<br>
+}<br>
+<br>
 //===----------------------------------------------------------------------===//<br>
 //     Extra additions to <memory><br>
 //===----------------------------------------------------------------------===//<br>
<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>