From: Chris Lattner Date: Thu, 21 Jun 2001 05:25:33 +0000 (+0000) Subject: Modified to use the new reduce_apply algorithm X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=681cf74ab5a417bf54de7ca168acce2a78b67d0f;p=oota-llvm.git 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 --- 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)); } //===----------------------------------------------------------------------===//