Reverting dtor devirtualization patch.
[oota-llvm.git] / include / llvm / PassManagers.h
index d7f3375dfe4bf5f73ee770a720e5119d390f9159..7c29263f3971405594133cea7f3d93f6ba7c26a0 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "llvm/PassManager.h"
 #include "llvm/ADT/SmallVector.h"
-using namespace llvm;
 class llvm::PMDataManager;
 class llvm::PMStack;
 
@@ -84,6 +83,9 @@ class llvm::PMStack;
 // MPPassManagers.
 //===----------------------------------------------------------------------===//
 
+#ifndef PASSMANAGERS_H
+#define PASSMANAGERS_H
+
 namespace llvm {
 
 /// FunctionPassManager and PassManager, two top level managers, serve 
@@ -127,10 +129,10 @@ public:
   virtual void addTopLevelPass(Pass  *P) = 0;
 
   /// Set pass P as the last user of the given analysis passes.
-  void setLastUser(std::vector<Pass *> &AnalysisPasses, Pass *P);
+  void setLastUser(SmallVector<Pass *, 12> &AnalysisPasses, Pass *P);
 
   /// Collect passes whose last user is P
-  void collectLastUses(std::vector<Pass *> &LastUses, Pass *P);
+  void collectLastUses(SmallVector<Pass *, 12> &LastUses, Pass *P);
 
   /// Find the pass that implements Analysis AID. Search immutable
   /// passes and all pass managers. If desired pass is not found
@@ -218,7 +220,7 @@ public:
   void removeNotPreservedAnalysis(Pass *P);
   
   /// Remove dead passes
-  void removeDeadPasses(Pass *P, std::string Msg, enum PassDebuggingString);
+  void removeDeadPasses(Pass *P, const char *Msg, enum PassDebuggingString);
 
   /// Add pass P into the PassVector. Update 
   /// AvailableAnalysis appropriately if ProcessAnalysis is true.
@@ -227,10 +229,7 @@ public:
   /// Add RequiredPass into list of lower level passes required by pass P.
   /// RequiredPass is run on the fly by Pass Manager when P requests it
   /// through getAnalysis interface.
-  virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
-    assert (0 && 
-            "Unable to handle Pass that requires lower level Analysis pass");
-  }
+  virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
 
   virtual Pass * getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) {
     assert (0 && "Unable to find on the fly pass");
@@ -276,7 +275,7 @@ public:
   void dumpLastUses(Pass *P, unsigned Offset) const;
   void dumpPassArguments() const;
   void dumpPassInfo(Pass *P, enum PassDebuggingString S1,
-                    enum PassDebuggingString S2, std::string Msg);
+                    enum PassDebuggingString S2, const char *Msg);
   void dumpAnalysisSetInfo(const char *Msg, Pass *P,
                            const std::vector<AnalysisID> &Set) const;
 
@@ -341,7 +340,7 @@ class FPPassManager : public ModulePass, public PMDataManager {
 public:
   static char ID;
   explicit FPPassManager(int Depth) 
-  : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
+  : ModulePass(intptr_t(&ID)), PMDataManager(Depth) { }
   
   /// run - Execute all of the passes scheduled for execution.  Keep track of
   /// whether any of the passes modifies the module, and if so, return true.
@@ -352,7 +351,7 @@ public:
   ///
   bool doInitialization(Module &M);
   
-  /// doFinalization - Run all of the initializers for the function passes.
+  /// doFinalization - Run all of the finalizers for the function passes.
   ///
   bool doFinalization(Module &M);
 
@@ -381,5 +380,8 @@ public:
 
 }
 
-extern void StartPassTimer(Pass *);
-extern void StopPassTimer(Pass *);
+extern void StartPassTimer(llvm::Pass *);
+extern void StopPassTimer(llvm::Pass *);
+
+#endif
+