summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-23 20:34:57 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-23 20:34:57 +0000
commit51c5a286bae5ad27ddc49602f44b7ea7253a4cc9 (patch)
tree23e5816bdf4e8ea6f02a6d639101c9132ac3ea54 /tools/bugpoint/ExecutionDriver.cpp
parentcc2e0845c30cbbf79b51c6c39c102af27c19a1a8 (diff)
downloadllvm-51c5a286bae5ad27ddc49602f44b7ea7253a4cc9.tar.gz
llvm-51c5a286bae5ad27ddc49602f44b7ea7253a4cc9.tar.bz2
llvm-51c5a286bae5ad27ddc49602f44b7ea7253a4cc9.tar.xz
For PR797:
Final removal of exceptions from lib/System and adjustment of users to accommodate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--tools/bugpoint/ExecutionDriver.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp
index 93eef5dbc5..2f75f62338 100644
--- a/tools/bugpoint/ExecutionDriver.cpp
+++ b/tools/bugpoint/ExecutionDriver.cpp
@@ -161,7 +161,12 @@ bool BugDriver::initializeExecutionEnvironment() {
void BugDriver::compileProgram(Module *M) {
// Emit the program to a bytecode file...
sys::Path BytecodeFile ("bugpoint-test-program.bc");
- BytecodeFile.makeUnique();
+ std::string ErrMsg;
+ if (BytecodeFile.makeUnique(true,&ErrMsg)) {
+ std::cerr << ToolName << ": Error making unique filename: " << ErrMsg
+ << "\n";
+ exit(1);
+ }
if (writeProgramToFile(BytecodeFile.toString(), M)) {
std::cerr << ToolName << ": Error emitting bytecode to file '"
<< BytecodeFile << "'!\n";
@@ -188,10 +193,15 @@ std::string BugDriver::executeProgram(std::string OutputFile,
if (AI == 0) AI = Interpreter;
assert(AI && "Interpreter should have been created already!");
bool CreatedBytecode = false;
+ std::string ErrMsg;
if (BytecodeFile.empty()) {
// Emit the program to a bytecode file...
sys::Path uniqueFilename("bugpoint-test-program.bc");
- uniqueFilename.makeUnique();
+ if (uniqueFilename.makeUnique(true, &ErrMsg)) {
+ std::cerr << ToolName << ": Error making unique filename: "
+ << ErrMsg << "!\n";
+ exit(1);
+ }
BytecodeFile = uniqueFilename.toString();
if (writeProgramToFile(BytecodeFile, Program)) {
@@ -210,7 +220,11 @@ std::string BugDriver::executeProgram(std::string OutputFile,
// Check to see if this is a valid output filename...
sys::Path uniqueFile(OutputFile);
- uniqueFile.makeUnique();
+ if (uniqueFile.makeUnique(true, &ErrMsg)) {
+ std::cerr << ToolName << ": Error making unique filename: "
+ << ErrMsg << "\n";
+ exit(1);
+ }
OutputFile = uniqueFile.toString();
// Figure out which shared objects to run, if any.