Skip to content
This repository has been archived by the owner on Jan 9, 2021. It is now read-only.

Commit

Permalink
Update comments, if we are running with the CBE, make sure the Interp…
Browse files Browse the repository at this point in the history
…reter

variable and the CBE variable are pointer equal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11599 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Feb 18, 2004
1 parent c8580b2 commit 7bb1154
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions tools/bugpoint/BugDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ class BugDriver {

/// 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.
/// 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 Bytecode = "",
Expand All @@ -182,13 +183,15 @@ class BugDriver {
bool *ProgramExitedNonzero = 0);

/// executeProgramWithCBE - Used to create reference output with the C
/// backend, if reference output is not provided.
/// 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 = "");

/// 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.
/// 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 &BytecodeFile = "",
const std::string &SharedObj = "",
Expand Down
11 changes: 7 additions & 4 deletions tools/bugpoint/ExecutionDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ bool BugDriver::initializeExecutionEnvironment() {

// Create an instance of the AbstractInterpreter interface as specified on
// the command line
cbe = 0;
std::string Message;
switch (InterpreterSel) {
case AutoPick:
InterpreterSel = RunCBE;
Interpreter = AbstractInterpreter::createCBE(getToolName(), Message);
Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message);
if (!Interpreter) {
InterpreterSel = RunJIT;
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message);
Expand Down Expand Up @@ -116,7 +117,7 @@ bool BugDriver::initializeExecutionEnvironment() {
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message);
break;
case RunCBE:
Interpreter = AbstractInterpreter::createCBE(getToolName(), Message);
Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message);
break;
default:
Message = "Sorry, this back-end is not supported by bugpoint right now!\n";
Expand All @@ -125,8 +126,10 @@ bool BugDriver::initializeExecutionEnvironment() {
std::cerr << Message;

// Initialize auxiliary tools for debugging
cbe = AbstractInterpreter::createCBE(getToolName(), Message);
if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
if (!cbe) {
cbe = AbstractInterpreter::createCBE(getToolName(), Message);
if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
}
gcc = GCC::create(getToolName(), Message);
if (!gcc) { std::cout << Message << "\nExiting.\n"; exit(1); }

Expand Down

0 comments on commit 7bb1154

Please sign in to comment.