Speculatively revert r108813, in an attempt to get the self-host buildbots working again.  I don't see why this patch
would cause them to fail the way they are, but none of the other intervening patches seem likely either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108818 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index 49b6640..45a0d4d 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/tools/bugpoint/BugDriver.cpp
@@ -56,8 +56,7 @@
 /// getPassesString - Turn a list of passes into a string which indicates the
 /// command line options that must be passed to add the passes.
 ///
-std::string
-llvm::getPassesString(const std::vector<const StaticPassInfo*> &Passes) {
+std::string llvm::getPassesString(const std::vector<const PassInfo*> &Passes) {
   std::string Result;
   for (unsigned i = 0, e = Passes.size(); i != e; ++i) {
     if (i) Result += " ";
diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h
index 36c90b0..4f6bae5 100644
--- a/tools/bugpoint/BugDriver.h
+++ b/tools/bugpoint/BugDriver.h
@@ -23,7 +23,7 @@
 namespace llvm {
 
 class Value;
-class StaticPassInfo;
+class PassInfo;
 class Module;
 class GlobalVariable;
 class Function;
@@ -47,7 +47,7 @@
   const char *ToolName;            // argv[0] of bugpoint
   std::string ReferenceOutputFile; // Name of `good' output file
   Module *Program;             // The raw program, linked together
-  std::vector<const StaticPassInfo*> PassesToRun;
+  std::vector<const PassInfo*> PassesToRun;
   AbstractInterpreter *Interpreter;   // How to run the program
   AbstractInterpreter *SafeInterpreter;  // To generate reference output, etc.
   GCC *gcc;
@@ -77,10 +77,10 @@
   bool addSources(const std::vector<std::string> &FileNames);
   template<class It>
   void addPasses(It I, It E) { PassesToRun.insert(PassesToRun.end(), I, E); }
-  void setPassesToRun(const std::vector<const StaticPassInfo*> &PTR) {
+  void setPassesToRun(const std::vector<const PassInfo*> &PTR) {
     PassesToRun = PTR;
   }
-  const std::vector<const StaticPassInfo*> &getPassesToRun() const {
+  const std::vector<const PassInfo*> &getPassesToRun() const {
     return PassesToRun;
   }
 
@@ -112,7 +112,7 @@
   /// ReferenceOutput contains the filename of the file containing the output we
   /// are to match.
   ///
-  bool debugPassMiscompilation(const StaticPassInfo *ThePass,
+  bool debugPassMiscompilation(const PassInfo *ThePass,
                                const std::string &ReferenceOutput);
 
   /// compileSharedObject - This method creates a SharedObject from a given
@@ -243,8 +243,7 @@
   /// failure.  If AutoDebugCrashes is set to true, then bugpoint will
   /// automatically attempt to track down a crashing pass if one exists, and
   /// this method will never return null.
-  Module *runPassesOn(Module *M,
-                      const std::vector<const StaticPassInfo*> &Passes,
+  Module *runPassesOn(Module *M, const std::vector<const PassInfo*> &Passes,
                       bool AutoDebugCrashes = false, unsigned NumExtraArgs = 0,
                       const char * const *ExtraArgs = NULL);
 
@@ -257,7 +256,7 @@
   /// or failed, unless Quiet is set.  ExtraArgs specifies additional arguments
   /// to pass to the child bugpoint instance.
   ///
-  bool runPasses(const std::vector<const StaticPassInfo*> &PassesToRun,
+  bool runPasses(const std::vector<const PassInfo*> &PassesToRun,
                  std::string &OutputFilename, bool DeleteOutput = false,
                  bool Quiet = false, unsigned NumExtraArgs = 0,
                  const char * const *ExtraArgs = NULL) const;
@@ -269,7 +268,7 @@
   /// If the passes did not compile correctly, output the command required to 
   /// recreate the failure. This returns true if a compiler error is found.
   ///
-  bool runManyPasses(const std::vector<const StaticPassInfo*> &AllPasses,
+  bool runManyPasses(const std::vector<const PassInfo*> &AllPasses,
                      std::string &ErrMsg);
 
   /// writeProgramToFile - This writes the current "Program" to the named
@@ -282,14 +281,14 @@
   /// false indicating whether or not the optimizer crashed on the specified
   /// input (true = crashed).
   ///
-  bool runPasses(const std::vector<const StaticPassInfo*> &PassesToRun,
+  bool runPasses(const std::vector<const PassInfo*> &PassesToRun,
                  bool DeleteOutput = true) const {
     std::string Filename;
     return runPasses(PassesToRun, Filename, DeleteOutput);
   }
 
   /// runAsChild - The actual "runPasses" guts that runs in a child process.
-  int runPassesAsChild(const std::vector<const StaticPassInfo*> &PassesToRun);
+  int runPassesAsChild(const std::vector<const PassInfo*> &PassesToRun);
 
   /// initializeExecutionEnvironment - This method is used to set up the
   /// environment for executing LLVM programs.
@@ -307,7 +306,7 @@
 /// getPassesString - Turn a list of passes into a string which indicates the
 /// command line options that must be passed to add the passes.
 ///
-std::string getPassesString(const std::vector<const StaticPassInfo*> &Passes);
+std::string getPassesString(const std::vector<const PassInfo*> &Passes);
 
 /// PrintFunctionList - prints out list of problematic functions
 ///
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index b0ee672..2d0631c 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/tools/bugpoint/CrashDebugger.cpp
@@ -43,7 +43,7 @@
 }
 
 namespace llvm {
-  class ReducePassList : public ListReducer<const StaticPassInfo*> {
+  class ReducePassList : public ListReducer<const PassInfo*> {
     BugDriver &BD;
   public:
     ReducePassList(BugDriver &bd) : BD(bd) {}
@@ -52,15 +52,15 @@
     // running the "Kept" passes fail when run on the output of the "removed"
     // passes.  If we return true, we update the current module of bugpoint.
     //
-    virtual TestResult doTest(std::vector<const StaticPassInfo*> &Removed,
-                              std::vector<const StaticPassInfo*> &Kept,
+    virtual TestResult doTest(std::vector<const PassInfo*> &Removed,
+                              std::vector<const PassInfo*> &Kept,
                               std::string &Error);
   };
 }
 
 ReducePassList::TestResult
-ReducePassList::doTest(std::vector<const StaticPassInfo*> &Prefix,
-                       std::vector<const StaticPassInfo*> &Suffix,
+ReducePassList::doTest(std::vector<const PassInfo*> &Prefix,
+                       std::vector<const PassInfo*> &Suffix,
                        std::string &Error) {
   sys::Path PrefixOutput;
   Module *OrigProgram = 0;
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 55c1780..d5611b5 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -99,8 +99,8 @@
   return Result;
 }
 
-static const StaticPassInfo *getPI(Pass *P) {
-  const StaticPassInfo *PI = P->getPassInfo();
+static const PassInfo *getPI(Pass *P) {
+  const PassInfo *PI = P->getPassInfo();
   delete P;
   return PI;
 }
@@ -114,7 +114,7 @@
   for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
     I->setLinkage(GlobalValue::ExternalLinkage);
 
-  std::vector<const StaticPassInfo*> CleanupPasses;
+  std::vector<const PassInfo*> CleanupPasses;
   CleanupPasses.push_back(getPI(createGlobalDCEPass()));
 
   if (MayModifySemantics)
@@ -138,7 +138,7 @@
 /// function.  This returns null if there are no extractable loops in the
 /// program or if the loop extractor crashes.
 Module *BugDriver::ExtractLoop(Module *M) {
-  std::vector<const StaticPassInfo*> LoopExtractPasses;
+  std::vector<const PassInfo*> LoopExtractPasses;
   LoopExtractPasses.push_back(getPI(createSingleLoopExtractorPass()));
 
   Module *NewM = runPassesOn(M, LoopExtractPasses);
@@ -359,7 +359,7 @@
   std::string uniqueFN = "--extract-blocks-file=" + uniqueFilename.str();
   const char *ExtraArg = uniqueFN.c_str();
 
-  std::vector<const StaticPassInfo*> PI;
+  std::vector<const PassInfo*> PI;
   std::vector<BasicBlock *> EmptyBBs; // This parameter is ignored.
   PI.push_back(getPI(createBlockExtractorPass(EmptyBBs)));
   Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
diff --git a/tools/bugpoint/FindBugs.cpp b/tools/bugpoint/FindBugs.cpp
index 5c1bede..224c717 100644
--- a/tools/bugpoint/FindBugs.cpp
+++ b/tools/bugpoint/FindBugs.cpp
@@ -29,8 +29,7 @@
 /// If the passes did not compile correctly, output the command required to 
 /// recreate the failure. This returns true if a compiler error is found.
 ///
-bool
-BugDriver::runManyPasses(const std::vector<const StaticPassInfo*> &AllPasses,
+bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses,
                               std::string &ErrMsg) {
   setPassesToRun(AllPasses);
   outs() << "Starting bug finding procedure...\n\n";
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index e40e5ef..47ac3c5 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -43,13 +43,13 @@
         cl::desc("Don't extract blocks when searching for miscompilations"),
         cl::init(false));
 
-  class ReduceMiscompilingPasses : public ListReducer<const StaticPassInfo*> {
+  class ReduceMiscompilingPasses : public ListReducer<const PassInfo*> {
     BugDriver &BD;
   public:
     ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {}
 
-    virtual TestResult doTest(std::vector<const StaticPassInfo*> &Prefix,
-                              std::vector<const StaticPassInfo*> &Suffix,
+    virtual TestResult doTest(std::vector<const PassInfo*> &Prefix,
+                              std::vector<const PassInfo*> &Suffix,
                               std::string &Error);
   };
 }
@@ -58,8 +58,8 @@
 /// group, see if they still break the program.
 ///
 ReduceMiscompilingPasses::TestResult
-ReduceMiscompilingPasses::doTest(std::vector<const StaticPassInfo*> &Prefix,
-                                 std::vector<const StaticPassInfo*> &Suffix,
+ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
+                                 std::vector<const PassInfo*> &Suffix,
                                  std::string &Error) {
   // First, run the program with just the Suffix passes.  If it is still broken
   // with JUST the kept passes, discard the prefix passes.
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 462718b..3a6149b 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -83,7 +83,7 @@
   outs() << getPassesString(PassesToRun) << "\n";
 }
 
-int BugDriver::runPassesAsChild(const std::vector<const StaticPassInfo*> &Passes) {
+int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
   std::string ErrInfo;
   raw_fd_ostream OutFile(ChildOutput.c_str(), ErrInfo,
                          raw_fd_ostream::F_Binary);
@@ -124,7 +124,7 @@
 /// outs() a single line message indicating whether compilation was successful
 /// or failed.
 ///
-bool BugDriver::runPasses(const std::vector<const StaticPassInfo*> &Passes,
+bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes,
                           std::string &OutputFilename, bool DeleteOutput,
                           bool Quiet, unsigned NumExtraArgs,
                           const char * const *ExtraArgs) const {
@@ -178,7 +178,7 @@
     pass_args.push_back( std::string("-load"));
     pass_args.push_back( PluginLoader::getPlugin(i));
   }
-  for (std::vector<const StaticPassInfo*>::const_iterator I = Passes.begin(),
+  for (std::vector<const PassInfo*>::const_iterator I = Passes.begin(),
        E = Passes.end(); I != E; ++I )
     pass_args.push_back( std::string("-") + (*I)->getPassArgument() );
   for (std::vector<std::string>::const_iterator I = pass_args.begin(),
@@ -235,7 +235,7 @@
 /// module, returning the transformed module on success, or a null pointer on
 /// failure.
 Module *BugDriver::runPassesOn(Module *M,
-                               const std::vector<const StaticPassInfo*> &Passes,
+                               const std::vector<const PassInfo*> &Passes,
                                bool AutoDebugCrashes, unsigned NumExtraArgs,
                                const char * const *ExtraArgs) {
   Module *OldProgram = swapProgramIn(M);
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp
index d4951ad..ba5234b 100644
--- a/tools/bugpoint/bugpoint.cpp
+++ b/tools/bugpoint/bugpoint.cpp
@@ -61,7 +61,7 @@
 // The AnalysesList is automatically populated with registered Passes by the
 // PassNameParser.
 //
-static cl::list<const StaticPassInfo*, bool, PassNameParser>
+static cl::list<const PassInfo*, bool, PassNameParser>
 PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
 
 static cl::opt<bool>
@@ -90,7 +90,7 @@
     AddToDriver(BugDriver &_D) : D(_D) {}
     
     virtual void add(Pass *P) {
-      const StaticPassInfo *PI = P->getPassInfo();
+      const PassInfo *PI = P->getPassInfo();
       D.addPasses(&PI, &PI + 1);
     }
   };