Modified to use the new reduce_apply algorithm
authorChris Lattner <sabre@nondot.org>
Thu, 21 Jun 2001 05:25:33 +0000 (05:25 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 21 Jun 2001 05:25:33 +0000 (05:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Optimizations/AllOpts.h

index 3ab7224bc7e22aa5f3b21255b8bf468b26350182..31a69c42537e93526d281945fd72028b415d974d 100644 (file)
@@ -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));
 }
 
 //===----------------------------------------------------------------------===//