diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-23 20:34:57 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-23 20:34:57 +0000 |
commit | e4ca722199b9f828affa45612dc09499eecff079 (patch) | |
tree | fdf3a7ca3d64b0e8ef6a5fd693d436d0cf2b5443 /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | 543cc0a2bc520094052621a53cb1487797a7e7f7 (diff) | |
download | bcm5719-llvm-e4ca722199b9f828affa45612dc09499eecff079.tar.gz bcm5719-llvm-e4ca722199b9f828affa45612dc09499eecff079.zip |
For PR797:
Final removal of exceptions from lib/System and adjustment of users to
accommodate.
llvm-svn: 29846
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index 4311200cc36..956faba41b9 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -139,12 +139,21 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, // setup the output file name std::cout << std::flush; sys::Path uniqueFilename("bugpoint-output.bc"); - uniqueFilename.makeUnique(); + std::string ErrMsg; + if (uniqueFilename.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << ": Error making unique filename: " + << ErrMsg << "\n"; + return(1); + } OutputFilename = uniqueFilename.toString(); // set up the input file name sys::Path inputFilename("bugpoint-input.bc"); - inputFilename.makeUnique(); + if (inputFilename.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << ": Error making unique filename: " + << ErrMsg << "\n"; + return(1); + } std::ios::openmode io_mode = std::ios::out | std::ios::trunc | std::ios::binary; std::ofstream InFile(inputFilename.c_str(), io_mode); @@ -179,7 +188,6 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, args[n++] = 0; sys::Path prog(sys::Program::FindProgramByName(ToolName)); - std::string ErrMsg; int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout,&ErrMsg); // If we are supposed to delete the bytecode file or if the passes crashed, |