diff options
Diffstat (limited to 'include/llvm/Transforms/Scalar/ConstantProp.h')
-rw-r--r-- | include/llvm/Transforms/Scalar/ConstantProp.h | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/include/llvm/Transforms/Scalar/ConstantProp.h b/include/llvm/Transforms/Scalar/ConstantProp.h index c4d973516c..3a8fa5b6d9 100644 --- a/include/llvm/Transforms/Scalar/ConstantProp.h +++ b/include/llvm/Transforms/Scalar/ConstantProp.h @@ -7,26 +7,19 @@ #ifndef LLVM_TRANSFORMS_SCALAR_CONSTANT_PROPOGATION_H #define LLVM_TRANSFORMS_SCALAR_CONSTANT_PROPOGATION_H -#include "llvm/Pass.h" #include "llvm/BasicBlock.h" class TerminatorInst; +class Pass; -struct ConstantPropogation : public MethodPass { - // doConstantPropogation - Do trivial constant propogation and expression - // folding - static bool doConstantPropogation(Method *M); - - // doConstantPropogation - Constant prop a specific instruction. Returns true - // and potentially moves the iterator if constant propogation was performed. - // - static bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &I); - - inline bool runOnMethod(Method *M) { - return doConstantPropogation(M); - } -}; - +//===----------------------------------------------------------------------===// +// Normal Constant Propogation Pass +// +Pass *createConstantPropogationPass(); +// doConstantPropogation - Constant prop a specific instruction. Returns true +// and potentially moves the iterator if constant propogation was performed. +// +bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &I); // ConstantFoldTerminator - If a terminator instruction is predicated on a // constant value, convert it into an unconditional branch to the constant @@ -38,12 +31,6 @@ bool ConstantFoldTerminator(TerminatorInst *T); //===----------------------------------------------------------------------===// // Sparse Conditional Constant Propogation Pass // -struct SCCPPass : public MethodPass { - static bool doSCCP(Method *M); - - inline bool runOnMethod(Method *M) { - return doSCCP(M); - } -}; +Pass *createSCCPPass(); #endif |