From 1890f94413b8921561f44c6783720b9b0ac69810 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 15 Nov 2004 07:15:04 +0000 Subject: [PATCH] Minor cleanups. There is no reason for SCCP to derive from instvisitor anymore. llvm-svn: 17825 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 35 ++++++++++++----------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 9b552014077e..603a52b23586 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -794,23 +794,21 @@ void SCCPSolver::Solve() { namespace { -//===----------------------------------------------------------------------===// -// -/// SCCP Class - This class does all of the work of Sparse Conditional Constant -/// Propagation. -/// -class SCCP : public FunctionPass, public InstVisitor { -public: - - // runOnFunction - Run the Sparse Conditional Constant Propagation algorithm, - // and return true if the function was modified. + //===--------------------------------------------------------------------===// // - bool runOnFunction(Function &F); - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesCFG(); - } -}; + /// SCCP Class - This class uses the SCCPSolver to implement a per-function + /// Sparse Conditional COnstant Propagator. + /// + struct SCCP : public FunctionPass { + // runOnFunction - Run the Sparse Conditional Constant Propagation + // algorithm, and return true if the function was modified. + // + bool runOnFunction(Function &F); + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); + } + }; RegisterOpt X("sccp", "Sparse Conditional Constant Propagation"); } // end anonymous namespace @@ -822,10 +820,6 @@ FunctionPass *llvm::createSCCPPass() { } -//===----------------------------------------------------------------------===// -// SCCP Class Implementation - - // runOnFunction() - Run the Sparse Conditional Constant Propagation algorithm, // and return true if the function was modified. // @@ -907,4 +901,3 @@ bool SCCP::runOnFunction(Function &F) { return MadeChanges; } -