[PATCH] Fix PR22179
Sanjoy Das
sanjoy at playingwithpointers.com
Sat Jan 10 15:44:57 PST 2015
REPOSITORY
rL LLVM
================
Comment at: lib/Analysis/ScalarEvolution.cpp:1758
@@ +1757,3 @@
+ auto IsKnownNonNegative =
+ std::bind1st(std::mem_fun(&ScalarEvolution::isKnownNonNegative), SE);
+
----------------
majnemer wrote:
> `std::bind1st` and `std::mem_fun` are deprecated in C++11, we should probably avoid new references to them.
>
> How about:
> auto IsKnownNonNegative =
> std::bind(std::mem_fn(&ScalarEvolution::isKnownNonNegative), SE));
Done.
================
Comment at: lib/Analysis/ScalarEvolution.cpp:1761
@@ +1760,3 @@
+ if (SignOrUnsignWrap == SCEV::FlagNSW)
+ if (std::all_of(Ops.begin(), Ops.end(), IsKnownNonNegative))
+ return ScalarEvolution::setFlags(OldFlags,
----------------
majnemer wrote:
> This looks way nicer :)
I changed this to `if (SignOrUnsignWrap == SCEV::FlagNSW && std::all_of(Ops.begin(), Ops.end(), IsKnownNonNegative))` before checking in -- that reduces one level of nesting.
http://reviews.llvm.org/D6914
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list