aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-21 05:25:33 +0000
committerChris Lattner <sabre@nondot.org>2001-06-21 05:25:33 +0000
commit681cf74ab5a417bf54de7ca168acce2a78b67d0f (patch)
tree681217bcd8c898e9fe1a9faa4f8fe90b94714764
parentbe0b11c611cc49043cba7c66de322f614bd987fe (diff)
Modified to use the new reduce_apply algorithm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Optimizations/AllOpts.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/llvm/Optimizations/AllOpts.h b/include/llvm/Optimizations/AllOpts.h
index 3ab7224bc7..31a69c4253 100644
--- a/include/llvm/Optimizations/AllOpts.h
+++ b/include/llvm/Optimizations/AllOpts.h
@@ -12,6 +12,7 @@
#include "llvm/Module.h"
#include "llvm/BasicBlock.h"
+#include "llvm/Tools/STLExtras.h"
class Method;
class CallInst;
@@ -20,11 +21,8 @@ class CallInst;
//
static inline bool ApplyOptToAllMethods(Module *C, bool (*Opt)(Method*)) {
- bool Modified = false;
- for (Module::MethodListType::iterator I = C->getMethodList().begin();
- I != C->getMethodList().end(); I++)
- Modified |= Opt(*I);
- return Modified;
+ return reduce_apply(C->getMethodList().begin(), C->getMethodList().end(),
+ bitwise_or<bool>(), false, ptr_fun(Opt));
}
//===----------------------------------------------------------------------===//