diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-26 21:46:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-26 21:46:54 +0000 |
commit | bd0ef77cde9c9e82f2b4ad33e4982c46274d6540 (patch) | |
tree | 0903b61112c9e6d336c8b623e235ede2f937f13c /lib/Transforms/LevelRaise.cpp | |
parent | 3b2541424f771ae11c30675ce06da7b380780028 (diff) | |
download | external_llvm-bd0ef77cde9c9e82f2b4ad33e4982c46274d6540.zip external_llvm-bd0ef77cde9c9e82f2b4ad33e4982c46274d6540.tar.gz external_llvm-bd0ef77cde9c9e82f2b4ad33e4982c46274d6540.tar.bz2 |
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
Diffstat (limited to 'lib/Transforms/LevelRaise.cpp')
-rw-r--r-- | lib/Transforms/LevelRaise.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index ef0a5fd..2826e9f 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -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(); +} + + |