Revert r168635 "Step towards implementation of pass manager with doInitialization...
[oota-llvm.git] / include / llvm / Pass.h
index a0cbca121d5e2ec1b727cb1c8feddd0de13098a5..7b6f169666a7d23f431c113b33cee2608b0c16db 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef LLVM_PASS_H
 #define LLVM_PASS_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
@@ -82,8 +83,8 @@ class Pass {
   AnalysisResolver *Resolver;  // Used to resolve analysis
   const void *PassID;
   PassKind Kind;
-  void operator=(const Pass&);  // DO NOT IMPLEMENT
-  Pass(const Pass &);           // DO NOT IMPLEMENT
+  void operator=(const Pass&) LLVM_DELETED_FUNCTION;
+  Pass(const Pass &) LLVM_DELETED_FUNCTION;
 
 public:
   explicit Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { }
@@ -177,7 +178,7 @@ public:
 
   // createPass - Create a object for the specified pass class,
   // or null if it is not known.
-  static Pass *createPass(char &TI);
+  static Pass *createPass(AnalysisID ID);
 
   /// getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to
   /// get analysis information that might be around, for example to update it.
@@ -226,10 +227,20 @@ public:
   /// createPrinterPass - Get a module printer pass.
   Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
 
+  /// doInitialization - Virtual method overridden by subclasses to do
+  /// any necessary initialization.
+  ///
+  virtual bool doInitialization()  { return false; }
+
   /// runOnModule - Virtual method overriden by subclasses to process the module
   /// being operated on.
   virtual bool runOnModule(Module &M) = 0;
 
+  /// doFinalization - Virtual method overriden by subclasses to do any post
+  /// processing needed after all passes have run.
+  ///
+  virtual bool doFinalization() { return false; }
+
   virtual void assignPassManager(PMStack &PMS,
                                  PassManagerType T);