Change over to use new style pass mechanism, now passes only expose small

creation functions in their public header file, unless they can help it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-02-26 21:46:54 +00:00
parent 3b2541424f
commit bd0ef77cde
32 changed files with 528 additions and 512 deletions

View File

@ -12,6 +12,7 @@
#include "llvm/iOther.h"
#include "llvm/iMemory.h"
#include "llvm/ConstantVals.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Scalar/DCE.h"
#include "llvm/Transforms/Scalar/ConstantHandling.h"
#include "llvm/Transforms/Scalar/ConstantProp.h"
@ -413,8 +414,7 @@ static bool DoRaisePass(Method *M) {
#if DEBUG_PEEPHOLE_INSTS
cerr << "Processing: " << *BI;
#endif
if (DeadCodeElimination::dceInstruction(BIL, BI) ||
ConstantPropogation::doConstantPropogation(BB, BI)) {
if (dceInstruction(BIL, BI) || doConstantPropogation(BB, BI)) {
Changed = true;
#ifdef DEBUG_PEEPHOLE_INSTS
cerr << "DeadCode Elinated!\n";
@ -429,12 +429,10 @@ static bool DoRaisePass(Method *M) {
}
// RaisePointerReferences::doit - Raise a method representation to a higher
// level.
//
bool RaisePointerReferences::doit(Method *M) {
static bool doRPR(Method *M) {
#ifdef DEBUG_PEEPHOLE_INSTS
cerr << "\n\n\nStarting to work on Method '" << M->getName() << "'\n";
#endif
@ -459,3 +457,15 @@ bool RaisePointerReferences::doit(Method *M) {
return Changed;
}
namespace {
struct RaisePointerReferences : public MethodPass {
virtual bool runOnMethod(Method *M) { return doRPR(M); }
};
}
Pass *createRaisePointerReferencesPass() {
return new RaisePointerReferences();
}