summaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-18 05:21:56 +0000
committerChris Lattner <sabre@nondot.org>2001-10-18 05:21:56 +0000
commitb44523bd9d8975e9ce7e6ac1360fbe8d447bff3a (patch)
tree7404dad3149d2e9cd9b0ababced565943b9bab9b /include/llvm/Transforms
parentedcf6491a8ca5317d036fc685fd2a1082cb9a1a5 (diff)
downloadexternal_llvm-b44523bd9d8975e9ce7e6ac1360fbe8d447bff3a.zip
external_llvm-b44523bd9d8975e9ce7e6ac1360fbe8d447bff3a.tar.gz
external_llvm-b44523bd9d8975e9ce7e6ac1360fbe8d447bff3a.tar.bz2
Convert to new simpler pass structure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/FunctionInlining.h4
-rw-r--r--include/llvm/Transforms/Scalar/ConstantProp.h9
-rw-r--r--include/llvm/Transforms/Scalar/DCE.h12
-rw-r--r--include/llvm/Transforms/Scalar/InductionVars.h16
-rw-r--r--include/llvm/Transforms/Scalar/SymbolStripping.h10
5 files changed, 23 insertions, 28 deletions
diff --git a/include/llvm/Transforms/FunctionInlining.h b/include/llvm/Transforms/FunctionInlining.h
index 5a87c1b..373708d 100644
--- a/include/llvm/Transforms/FunctionInlining.h
+++ b/include/llvm/Transforms/FunctionInlining.h
@@ -13,13 +13,13 @@ class CallInst;
namespace opt {
-struct MethodInlining : public StatelessPass<MethodInlining> {
+struct MethodInlining : public Pass {
// DoMethodInlining - Use a heuristic based approach to inline methods that
// seem to look good.
//
static bool doMethodInlining(Method *M);
- inline static bool doPerMethodWork(Method *M) {
+ virtual bool doPerMethodWork(Method *M) {
return doMethodInlining(M);
}
};
diff --git a/include/llvm/Transforms/Scalar/ConstantProp.h b/include/llvm/Transforms/Scalar/ConstantProp.h
index 3cf6d94..918ef07 100644
--- a/include/llvm/Transforms/Scalar/ConstantProp.h
+++ b/include/llvm/Transforms/Scalar/ConstantProp.h
@@ -12,12 +12,12 @@ class TerminatorInst;
namespace opt {
-struct ConstantPropogation : public StatelessPass<ConstantPropogation> {
+struct ConstantPropogation : public Pass {
// doConstantPropogation - Do trivial constant propogation and expression
// folding
static bool doConstantPropogation(Method *M);
- inline static bool doPerMethodWork(Method *M) {
+ inline bool doPerMethodWork(Method *M) {
return doConstantPropogation(M);
}
};
@@ -34,11 +34,10 @@ bool ConstantFoldTerminator(TerminatorInst *T);
//===----------------------------------------------------------------------===//
// Sparse Conditional Constant Propogation Pass
//
-
-struct SCCPPass : public StatelessPass<SCCPPass> {
+struct SCCPPass : public Pass {
static bool doSCCP(Method *M);
- inline static bool doPerMethodWork(Method *M) {
+ inline bool doPerMethodWork(Method *M) {
return doSCCP(M);
}
};
diff --git a/include/llvm/Transforms/Scalar/DCE.h b/include/llvm/Transforms/Scalar/DCE.h
index 287a2a8..9a7bd6e 100644
--- a/include/llvm/Transforms/Scalar/DCE.h
+++ b/include/llvm/Transforms/Scalar/DCE.h
@@ -12,7 +12,7 @@
namespace opt {
-struct DeadCodeElimination : public StatelessPass<DeadCodeElimination> {
+struct DeadCodeElimination : public Pass {
// External Interface:
//
static bool doDCE(Method *M);
@@ -32,23 +32,23 @@ struct DeadCodeElimination : public StatelessPass<DeadCodeElimination> {
// static bool RemoveUnusedGlobalValuesAfterLink(Module *M); // TODO
// Pass Interface...
- inline static bool doPassInitialization(Module *M) {
+ virtual bool doPassInitialization(Module *M) {
return RemoveUnusedGlobalValues(M);
}
- inline static bool doPerMethodWork(Method *M) { return doDCE(M); }
- inline static bool doPassFinalization(Module *M) {
+ virtual bool doPerMethodWork(Method *M) { return doDCE(M); }
+ virtual bool doPassFinalization(Module *M) {
return RemoveUnusedGlobalValues(M);
}
};
-struct AgressiveDCE : public StatelessPass<AgressiveDCE> {
+struct AgressiveDCE : public Pass {
// DoADCE - Execute the Agressive Dead Code Elimination Algorithm
//
static bool doADCE(Method *M); // Defined in ADCE.cpp
- inline static bool doPerMethodWork(Method *M) {
+ virtual bool doPerMethodWork(Method *M) {
return doADCE(M);
}
};
diff --git a/include/llvm/Transforms/Scalar/InductionVars.h b/include/llvm/Transforms/Scalar/InductionVars.h
index 48b267c..e0c46d8 100644
--- a/include/llvm/Transforms/Scalar/InductionVars.h
+++ b/include/llvm/Transforms/Scalar/InductionVars.h
@@ -13,17 +13,13 @@
namespace opt {
-// DoInductionVariableCannonicalize - Simplify induction variables in loops
-//
-bool DoInductionVariableCannonicalize(Method *M);
-static inline bool DoInductionVariableCannonicalize(Module *M) {
- return M->reduceApply(DoInductionVariableCannonicalize);
-}
+struct InductionVariableCannonicalize : public Pass {
+ // doInductionVariableCannonicalize - Simplify induction variables in loops
+ //
+ static bool doIt(Method *M);
-struct InductionVariableCannonicalize :
- public StatelessPass<InductionVariableCannonicalize> {
- inline static bool doPerMethodWork(Method *M) {
- return DoInductionVariableCannonicalize(M);
+ virtual bool doPerMethodWork(Method *M) {
+ return doIt(M);
}
};
diff --git a/include/llvm/Transforms/Scalar/SymbolStripping.h b/include/llvm/Transforms/Scalar/SymbolStripping.h
index 83724eb..a5540f9 100644
--- a/include/llvm/Transforms/Scalar/SymbolStripping.h
+++ b/include/llvm/Transforms/Scalar/SymbolStripping.h
@@ -14,28 +14,28 @@ class Module;
namespace opt {
-struct SymbolStripping : public StatelessPass<SymbolStripping> {
+struct SymbolStripping : public Pass {
// doSymbolStripping - Remove all symbolic information from a method
//
static bool doSymbolStripping(Method *M);
- inline static bool doPerMethodWork(Method *M) {
+ virtual bool doPerMethodWork(Method *M) {
return doSymbolStripping(M);
}
};
-struct FullSymbolStripping : public StatelessPass<FullSymbolStripping> {
+struct FullSymbolStripping : public Pass {
// doStripGlobalSymbols - Remove all symbolic information from all methods
// in a module, and all module level symbols. (method names, etc...)
//
static bool doStripGlobalSymbols(Module *M);
- inline static bool doPassInitialization(Module *M) {
+ virtual bool doPassInitialization(Module *M) {
return doStripGlobalSymbols(M);
}
- inline static bool doPerMethodWork(Method *M) {
+ virtual bool doPerMethodWork(Method *M) {
return SymbolStripping::doSymbolStripping(M);
}
};