aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index ada670deb8..447a3e1960 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -25,6 +25,7 @@
#include "llvm/iMemory.h"
#include "llvm/iTerminators.h"
#include "llvm/iOther.h"
+#include "llvm/Pass.h"
#include "llvm/Assembly/Writer.h"
#include "Support/STLExtras.h"
#include <algorithm>
@@ -503,11 +504,18 @@ void SCCP::OperandChangedState(User *U) {
UpdateInstruction(I);
}
+namespace {
+ // SCCPPass - Use Sparse Conditional Constant Propogation
+ // to prove whether a value is constant and whether blocks are used.
+ //
+ struct SCCPPass : public MethodPass {
+ inline bool runOnMethod(Method *M) {
+ SCCP S(M);
+ return S.doSCCP();
+ }
+ };
+}
-// DoSparseConditionalConstantProp - Use Sparse Conditional Constant Propogation
-// to prove whether a value is constant and whether blocks are used.
-//
-bool SCCPPass::doSCCP(Method *M) {
- SCCP S(M);
- return S.doSCCP();
+Pass *createSCCPPass() {
+ return new SCCPPass();
}