X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fbugpoint%2FExecutionDriver.cpp;h=3b93a1a3224b0f51d6e88e290999d49774fdcbcd;hb=16350f8d00fc3a4a8d2da8a746a29979505af9a8;hp=feda331177b166a62536526ccf85c0e882a029ca;hpb=68ccdaa84909108c42417a8091c771598e26456e;p=oota-llvm.git diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index feda331177b..3b93a1a3224 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -28,7 +28,7 @@ namespace { // for miscompilation. // enum OutputType { - AutoPick, RunLLI, RunJIT, RunLLC, RunCBE, CBE_bug, LLC_Safe, Custom + AutoPick, RunLLI, RunJIT, RunLLC, RunLLCIA, RunCBE, CBE_bug, LLC_Safe,Custom }; cl::opt @@ -45,6 +45,8 @@ namespace { "Execute with the interpreter"), clEnumValN(RunJIT, "run-jit", "Execute with JIT"), clEnumValN(RunLLC, "run-llc", "Compile with LLC"), + clEnumValN(RunLLCIA, "run-llc-ia", + "Compile with LLC with integrated assembler"), clEnumValN(RunCBE, "run-cbe", "Compile with CBE"), clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"), clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"), @@ -168,9 +170,11 @@ bool BugDriver::initializeExecutionEnvironment() { &ToolArgv); break; case RunLLC: + case RunLLCIA: case LLC_Safe: Interpreter = AbstractInterpreter::createLLC(getToolName(), Message, - &ToolArgv, &GCCToolArgv); + &ToolArgv, &GCCToolArgv, + InterpreterSel == RunLLCIA); break; case RunJIT: Interpreter = AbstractInterpreter::createJIT(getToolName(), Message, @@ -244,10 +248,12 @@ bool BugDriver::initializeExecutionEnvironment() { } break; case RunLLC: + case RunLLCIA: SafeToolArgs.push_back("--relocation-model=pic"); SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message, &SafeToolArgs, - &GCCToolArgv); + &GCCToolArgv, + SafeInterpreterSel == RunLLCIA); break; case RunCBE: SafeInterpreter = AbstractInterpreter::createCBE(Path.c_str(), Message, @@ -306,8 +312,7 @@ void BugDriver::compileProgram(Module *M) { std::string BugDriver::executeProgram(std::string OutputFile, std::string BitcodeFile, const std::string &SharedObj, - AbstractInterpreter *AI, - bool *ProgramExitedNonzero) { + AbstractInterpreter *AI) { if (AI == 0) AI = Interpreter; assert(AI && "Interpreter should have been created already!"); bool CreatedBitcode = false; @@ -331,7 +336,7 @@ std::string BugDriver::executeProgram(std::string OutputFile, } // Remove the temporary bitcode file when we are done. - sys::Path BitcodePath (BitcodeFile); + sys::Path BitcodePath(BitcodeFile); FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode && !SaveTemps); if (OutputFile.empty()) OutputFile = OutputPrefix + "-execution-output"; @@ -373,9 +378,6 @@ std::string BugDriver::executeProgram(std::string OutputFile, outFile.close(); } - if (ProgramExitedNonzero != 0) - *ProgramExitedNonzero = (RetVal != 0); - // Return the filename we captured the output to. return OutputFile; } @@ -384,9 +386,7 @@ std::string BugDriver::executeProgram(std::string OutputFile, /// backend, if reference output is not provided. /// std::string BugDriver::executeProgramSafely(std::string OutputFile) { - bool ProgramExitedNonzero; - std::string outFN = executeProgram(OutputFile, "", "", SafeInterpreter, - &ProgramExitedNonzero); + std::string outFN = executeProgram(OutputFile, "", "", SafeInterpreter); return outFN; } @@ -443,11 +443,8 @@ bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) { bool BugDriver::diffProgram(const std::string &BitcodeFile, const std::string &SharedObject, bool RemoveBitcode) { - bool ProgramExitedNonzero; - // Execute the program, generating an output file... - sys::Path Output(executeProgram("", BitcodeFile, SharedObject, 0, - &ProgramExitedNonzero)); + sys::Path Output(executeProgram("", BitcodeFile, SharedObject, 0)); std::string Error; bool FilesDifferent = false;