Modified to use the new reduce_apply algorithm

llvm-svn: 49
This commit is contained in:
Chris Lattner 2001-06-21 05:25:33 +00:00
parent 570f10ad47
commit e3b1bacb6e
1 changed files with 3 additions and 5 deletions

View 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));
}
//===----------------------------------------------------------------------===//