diff options
Diffstat (limited to 'include/llvm/Transforms/IPO/ConstantMerge.h')
-rw-r--r-- | include/llvm/Transforms/IPO/ConstantMerge.h | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/include/llvm/Transforms/IPO/ConstantMerge.h b/include/llvm/Transforms/IPO/ConstantMerge.h index efc91f400b..b25fb66670 100644 --- a/include/llvm/Transforms/IPO/ConstantMerge.h +++ b/include/llvm/Transforms/IPO/ConstantMerge.h @@ -17,44 +17,8 @@ #ifndef LLVM_TRANSFORMS_CONSTANTMERGE_H #define LLVM_TRANSFORMS_CONSTANTMERGE_H -#include "llvm/Pass.h" -class Constant; -class GlobalVariable; - -// FIXME: ConstantMerge should not be a methodPass!!! -class ConstantMerge : public MethodPass { -protected: - std::map<Constant*, GlobalVariable*> Constants; - unsigned LastConstantSeen; -public: - inline ConstantMerge() : LastConstantSeen(0) {} - - // mergeDuplicateConstants - Static accessor for clients that don't want to - // deal with passes. - // - static bool mergeDuplicateConstants(Module *M); - - // doInitialization - For this pass, process all of the globals in the - // module, eliminating duplicate constants. - // - bool doInitialization(Module *M); - - bool runOnMethod(Method*) { return false; } - - // doFinalization - Clean up internal state for this module - // - bool doFinalization(Module *M) { - LastConstantSeen = 0; - Constants.clear(); - return false; - } -}; - -struct DynamicConstantMerge : public ConstantMerge { - // doPerMethodWork - Check to see if any globals have been added to the - // global list for the module. If so, eliminate them. - // - bool runOnMethod(Method *M); -}; +class Pass; +Pass *createConstantMergePass(); +Pass *createDynamicConstantMergePass(); #endif |