return DoRaiseRepresentation(M, Level::Highest);
}
- struct RaiseRepresentation : public StatelessPass<RaiseRepresentation> {
- inline static bool doPerMethodWork(Method *M) {
+ struct RaiseRepresentation : public Pass {
+ virtual bool doPerMethodWork(Method *M) {
return DoRaiseRepresentation(M);
}
};
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);
}
};
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);
}
};
//===----------------------------------------------------------------------===//
// 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);
}
};
namespace opt {
-struct DeadCodeElimination : public StatelessPass<DeadCodeElimination> {
+struct DeadCodeElimination : public Pass {
// External Interface:
//
static bool doDCE(Method *M);
// 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);
}
};
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);
}
};
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);
}
};