[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 14 23:15:16 PST 2004



Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.109 -> 1.110
---
Log message:

Minor cleanups.  There is no reason for SCCP to derive from instvisitor anymore.


---
Diffs of the changes:  (+14 -21)

Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.109 llvm/lib/Transforms/Scalar/SCCP.cpp:1.110
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.109	Mon Nov 15 01:02:42 2004
+++ llvm/lib/Transforms/Scalar/SCCP.cpp	Mon Nov 15 01:15:04 2004
@@ -794,23 +794,21 @@
 
 
 namespace {
-//===----------------------------------------------------------------------===//
-//
-/// SCCP Class - This class does all of the work of Sparse Conditional Constant
-/// Propagation.
-///
-class SCCP : public FunctionPass, public InstVisitor<SCCP> {
-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<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
 } // end anonymous namespace
@@ -822,10 +820,6 @@
 }
 
 
-//===----------------------------------------------------------------------===//
-// SCCP Class Implementation
-
-
 // runOnFunction() - Run the Sparse Conditional Constant Propagation algorithm,
 // and return true if the function was modified.
 //
@@ -907,4 +901,3 @@
   return MadeChanges;
 }
 
-






More information about the llvm-commits mailing list