diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-15 01:53:08 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-15 01:53:08 +0000 |
commit | 97182985d530dbef488696c95a39c14fe56c995b (patch) | |
tree | 00a87f3cf72f41a06622506764322dac63ebca9f /tools/bugpoint/ExecutionDriver.cpp | |
parent | cda985e1912d6f09a21bc84660dca4c3efdcb939 (diff) | |
download | external_llvm-97182985d530dbef488696c95a39c14fe56c995b.zip external_llvm-97182985d530dbef488696c95a39c14fe56c995b.tar.gz external_llvm-97182985d530dbef488696c95a39c14fe56c995b.tar.bz2 |
For PR351:
* Convert use of getUniqueFilename to sys::Path::makeUnique();
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18949 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 0687c4c..fbba687 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -152,18 +152,19 @@ bool BugDriver::initializeExecutionEnvironment() { /// void BugDriver::compileProgram(Module *M) { // Emit the program to a bytecode file... - std::string BytecodeFile = getUniqueFilename("bugpoint-test-program.bc"); - if (writeProgramToFile(BytecodeFile, M)) { + sys::Path BytecodeFile ("bugpoint-test-program.bc"); + BytecodeFile.makeUnique(); + if (writeProgramToFile(BytecodeFile.toString(), M)) { std::cerr << ToolName << ": Error emitting bytecode to file '" << BytecodeFile << "'!\n"; exit(1); } // Remove the temporary bytecode file when we are done. - FileRemover BytecodeFileRemover(BytecodeFile); + FileRemover BytecodeFileRemover(BytecodeFile.toString()); // Actually compile the program! - Interpreter->compileProgram(BytecodeFile); + Interpreter->compileProgram(BytecodeFile.toString()); } @@ -181,7 +182,9 @@ std::string BugDriver::executeProgram(std::string OutputFile, bool CreatedBytecode = false; if (BytecodeFile.empty()) { // Emit the program to a bytecode file... - BytecodeFile = getUniqueFilename("bugpoint-test-program.bc"); + sys::Path uniqueFilename("bugpoint-test-program.bc"); + uniqueFilename.makeUnique(); + BytecodeFile = uniqueFilename.toString(); if (writeProgramToFile(BytecodeFile, Program)) { std::cerr << ToolName << ": Error emitting bytecode to file '" @@ -197,7 +200,9 @@ std::string BugDriver::executeProgram(std::string OutputFile, if (OutputFile.empty()) OutputFile = "bugpoint-execution-output"; // Check to see if this is a valid output filename... - OutputFile = getUniqueFilename(OutputFile); + sys::Path uniqueFile(OutputFile); + uniqueFile.makeUnique(); + OutputFile = uniqueFile.toString(); // Figure out which shared objects to run, if any. std::vector<std::string> SharedObjs(AdditionalSOs); |