Instead of abusing swapProgramIn, just add a Module argument to
[oota-llvm.git] / tools / bugpoint / BugDriver.h
index e259dd95ce9894cdc32d5ce33909ec65bd9340f5..6a7f47130a9189a7d7f5f920905205ff5a5b0cd3 100644 (file)
 #ifndef BUGDRIVER_H
 #define BUGDRIVER_H
 
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/Support/CommandLine.h"
+#include "llvm/ADT/ValueMap.h"
 #include <vector>
 #include <string>
 
-extern llvm::cl::opt<bool> StripDebug;
-
 namespace llvm {
 
 class Value;
@@ -208,10 +205,11 @@ public:
                    bool RemoveBitcode = false,
                    std::string *Error = 0);
 
-  /// EmitProgressBitcode - This function is used to output the current Program
-  /// to a file named "bugpoint-ID.bc".
+  /// EmitProgressBitcode - This function is used to output M to a file named
+  /// "bugpoint-ID.bc".
   ///
-  void EmitProgressBitcode(const std::string &ID, bool NoFlyer = false);
+  void EmitProgressBitcode(const Module *M, const std::string &ID,
+                           bool NoFlyer = false);
 
   /// deleteInstructionFromProgram - This method clones the current Program and
   /// deletes the specified instruction from the cloned module.  It then runs a
@@ -272,12 +270,12 @@ public:
   /// recreate the failure. This returns true if a compiler error is found.
   ///
   bool runManyPasses(const std::vector<const PassInfo*> &AllPasses,
-                    std::string &ErrMsg);
+                     std::string &ErrMsg);
 
   /// writeProgramToFile - This writes the current "Program" to the named
   /// bitcode file.  If an error occurs, true is returned.
   ///
-  bool writeProgramToFile(const std::string &Filename, Module *M = 0) const;
+  bool writeProgramToFile(const std::string &Filename, const Module *M) const;
 
 private:
   /// runPasses - Just like the method above, but this just returns true or
@@ -328,7 +326,7 @@ void DeleteFunctionBody(Function *F);
 /// module, split the functions OUT of the specified module, and place them in
 /// the new module.
 Module *SplitFunctionsOutOfModule(Module *M, const std::vector<Function*> &F,
-                                  DenseMap<const Value*, Value*> &ValueMap);
+                                  ValueMap<const Value*, Value*> &VMap);
 
 } // End llvm namespace