diff options
| -rw-r--r-- | llvm/include/llvm/ADT/SetVector.h | 5 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SROA.cpp | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/include/llvm/ADT/SetVector.h b/llvm/include/llvm/ADT/SetVector.h index e8d63edf9e5..0ff0f46f88d 100644 --- a/llvm/include/llvm/ADT/SetVector.h +++ b/llvm/include/llvm/ADT/SetVector.h @@ -141,8 +141,9 @@ public: /// \returns true if any element is removed. template <typename UnaryPredicate> bool remove_if(UnaryPredicate P) { - typename vector_type::iterator B = std::remove_if(vector_.begin(), - vector_.end(), P), + typename vector_type::iterator B = std::partition(vector_.begin(), + vector_.end(), + std::not1(P)), E = vector_.end(); if (B == E) return false; diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index 58c3bc0f200..316742a0da6 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -3273,8 +3273,10 @@ namespace { const SetType &Set; public: + typedef AllocaInst *argument_type; + IsAllocaInSet(const SetType &Set) : Set(Set) {} - bool operator()(AllocaInst *AI) { return Set.count(AI); } + bool operator()(AllocaInst *AI) const { return Set.count(AI); } }; } |

