#ifndef BUGDRIVER_H
#define BUGDRIVER_H
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/ValueMap.h"
#include <vector>
#include <string>
void compileProgram(Module *M, std::string *Error);
/// executeProgram - This method runs "Program", capturing the output of the
- /// program to a file. The recommended filename will be filled in with the
- /// name of the file with the captured output. If there is a problem with
- /// the code generator (e.g., llc crashes), this will throw an exception.
+ /// program to a file. A recommended filename may be optionally specified.
///
std::string executeProgram(std::string OutputFilename,
std::string Bitcode,
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
/// 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
/// 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