summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/LevelRaise.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-26 21:46:54 +0000
committerChris Lattner <sabre@nondot.org>2002-02-26 21:46:54 +0000
commit04805fa29cfed84fd748ff2f97da3968282ee3b1 (patch)
tree7f2bfbac67628f247c8929af9f6a6e352936e7d5 /llvm/lib/Transforms/LevelRaise.cpp
parentb67f732b8cc2e1817a1318d596a9665d5c5c5057 (diff)
downloadbcm5719-llvm-04805fa29cfed84fd748ff2f97da3968282ee3b1.tar.gz
bcm5719-llvm-04805fa29cfed84fd748ff2f97da3968282ee3b1.zip
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. llvm-svn: 1816
Diffstat (limited to 'llvm/lib/Transforms/LevelRaise.cpp')
-rw-r--r--llvm/lib/Transforms/LevelRaise.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/LevelRaise.cpp b/llvm/lib/Transforms/LevelRaise.cpp
index ef0a5fd314d..2826e9f216c 100644
--- a/llvm/lib/Transforms/LevelRaise.cpp
+++ b/llvm/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();
+}
+
+
OpenPOWER on IntegriCloud