+ bool isExecutingJIT();
+
+ /// runPasses - Run all of the passes in the "PassesToRun" list, discard the
+ /// output, and return true if any of the passes crashed.
+ bool runPasses(Module *M = 0) {
+ if (M == 0) M = Program;
+ std::swap(M, Program);
+ bool Result = runPasses(PassesToRun);
+ std::swap(M, Program);
+ return Result;
+ }
+
+ Module *getProgram() const { return Program; }
+
+ /// swapProgramIn - Set the current module to the specified module, returning
+ /// the old one.
+ Module *swapProgramIn(Module *M) {
+ Module *OldProgram = Program;
+ Program = M;
+ return OldProgram;
+ }
+
+ AbstractInterpreter *switchToCBE() {
+ AbstractInterpreter *Old = Interpreter;
+ Interpreter = (AbstractInterpreter*)cbe;
+ return Old;
+ }
+
+ void switchToInterpreter(AbstractInterpreter *AI) {
+ Interpreter = AI;
+ }
+
+ /// setNewProgram - If we reduce or update the program somehow, call this
+ /// method to update bugdriver with it. This deletes the old module and sets
+ /// the specified one as the current program.
+ void setNewProgram(Module *M);
+
+ /// compileProgram - Try to compile the specified module, throwing an
+ /// exception if an error occurs, or returning normally if not. This is used
+ /// for code generation crash testing.
+ ///
+ void compileProgram(Module *M);
+
+ /// executeProgram - This method runs "Program", capturing the output of the
+ /// program to a file, returning the filename of the file. A recommended
+ /// filename may be optionally specified. If there is a problem with the code
+ /// generator (e.g., llc crashes), this will throw an exception.
+ ///
+ std::string executeProgram(std::string RequestedOutputFilename = "",
+ std::string Bitcode = "",
+ const std::string &SharedObjects = "",
+ AbstractInterpreter *AI = 0,
+ bool *ProgramExitedNonzero = 0);
+
+ /// executeProgramWithCBE - Used to create reference output with the C
+ /// backend, if reference output is not provided. If there is a problem with
+ /// the code generator (e.g., llc crashes), this will throw an exception.
+ ///
+ std::string executeProgramWithCBE(std::string OutputFile = "");
+
+ /// createReferenceFile - calls compileProgram and then records the output
+ /// into ReferenceOutputFile. Returns true if reference file created, false
+ /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE
+ /// this function.
+ ///
+ bool createReferenceFile(Module *M, const std::string &Filename
+ = "bugpoint.reference.out");
+
+ /// diffProgram - This method executes the specified module and diffs the
+ /// output against the file specified by ReferenceOutputFile. If the output
+ /// is different, true is returned. If there is a problem with the code
+ /// generator (e.g., llc crashes), this will throw an exception.
+ ///
+ bool diffProgram(const std::string &BitcodeFile = "",
+ const std::string &SharedObj = "",
+ bool RemoveBitcode = false);
+
+ /// EmitProgressBitcode - This function is used to output the current Program
+ /// to a file named "bugpoint-ID.bc".
+ ///
+ void EmitProgressBitcode(const std::string &ID, bool NoFlyer = false);