Convert to new simpler Pass structure
authorChris Lattner <sabre@nondot.org>
Thu, 18 Oct 2001 05:22:15 +0000 (05:22 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Oct 2001 05:22:15 +0000 (05:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@878 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/ChangeAllocations.h
include/llvm/Transforms/HoistPHIConstants.h
include/llvm/Transforms/PrintModulePass.h

index 4c36b2d4c0032f77f81daae88e9158ff86ed9d18..46efa26077b92eb9708b1845eca41eb77ec296b6 100644 (file)
@@ -13,7 +13,7 @@
 #include "llvm/Transforms/Pass.h"
 class TargetData;
 
-class LowerAllocations : public ConcretePass {
+class LowerAllocations : public Pass {
   Method *MallocMeth;   // Methods in the module we are processing
   Method *FreeMeth;     // Initialized by doPassInitializationVirt
 
@@ -28,12 +28,12 @@ public:
   //
   // This function is always successful.
   //
-  bool doPassInitializationVirt(Module *M);
+  bool doPassInitialization(Module *M);
 
   // doPerMethodWork - This method does the actual work of converting
   // instructions over, assuming that the pass has already been initialized.
   //
-  bool doPerMethodWorkVirt(Method *M);
+  bool doPerMethodWork(Method *M);
 };
 
 #endif
index d15ead91f432adf83138f3f3cbb78e3b440e0986..931269bc0b13f3a38fc522c070ffb3973f7a91bc 100644 (file)
 
 #include "llvm/Transforms/Pass.h"
 
-struct HoistPHIConstants : public StatelessPass<HoistPHIConstants> {
-  // doPerMethodWork - This method does the work.  Always successful.
-  //
-  static bool doPerMethodWork(Method *M);
+struct HoistPHIConstants : public Pass {
+  static bool doHoistPHIConstants(Method *M);
+
+
+  virtual bool doPerMethodWork(Method *M) { return doHoistPHIConstants(M); }
 };
 
 #endif
index 0e2cee1599754537feba8931ce747cd77d3fa5f1..98948d88440469bbc4fc7531f45eab7c6b598b25 100644 (file)
@@ -11,7 +11,7 @@
 #include "llvm/Transforms/Pass.h"
 #include "llvm/Assembly/Writer.h"
 
-class PrintModulePass : public ConcretePass {
+class PrintModulePass : public Pass {
   string Banner;          // String to print before each method
   ostream *Out;           // ostream to print on
   bool DeleteStream;      // Delete the ostream in our dtor?
@@ -26,7 +26,7 @@ public:
   // doPerMethodWork - This pass just prints a banner followed by the method as
   // it's processed.
   //
-  bool doPerMethodWorkVirt(Method *M) {
+  bool doPerMethodWork(Method *M) {
     (*Out) << Banner << M;
     return false;
   }