summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit04805fa29cfed84fd748ff2f97da3968282ee3b1 (patch)
tree7f2bfbac67628f247c8929af9f6a6e352936e7d5 /llvm/lib/Transforms/Scalar/SCCP.cpp
parentb67f732b8cc2e1817a1318d596a9665d5c5c5057 (diff)
downloadbcm5719-llvm-04805fa29cfed84fd748ff2f97da3968282ee3b1.tar.gz
bcm5719-llvm-04805fa29cfed84fd748ff2f97da3968282ee3b1.zip
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. llvm-svn: 1816
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index ada670deb81..447a3e19600 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/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();
}
OpenPOWER on IntegriCloud