From 681cf74ab5a417bf54de7ca168acce2a78b67d0f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 21 Jun 2001 05:25:33 +0000 Subject: [PATCH] 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 --- include/llvm/Optimizations/AllOpts.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/llvm/Optimizations/AllOpts.h b/include/llvm/Optimizations/AllOpts.h index 3ab7224bc7e..31a69c42537 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(), false, ptr_fun(Opt)); } //===----------------------------------------------------------------------===// -- 2.34.1