aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-26 21:46:54 +0000
committerChris Lattner <sabre@nondot.org>2002-02-26 21:46:54 +0000
commitbd0ef77cde9c9e82f2b4ad33e4982c46274d6540 (patch)
tree0903b61112c9e6d336c8b623e235ede2f937f13c /lib/Transforms/Scalar/SCCP.cpp
parent3b2541424f771ae11c30675ce06da7b380780028 (diff)
Change over to use new style pass mechanism, now passes only expose small
creation functions in their public header file, unless they can help it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1816 91177308-0d34-0410-b5e6-96231b3b80d8
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();
}