diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-18 17:01:00 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-18 17:01:00 +0000 |
commit | 4526b1d410a3d6d5571ddd27e2531aad13ca6093 (patch) | |
tree | 33881cc05fe06c141bd993614a9067442d3eb525 /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | a637fb8ccdecd5b0a1171f262b48d62efe9452bd (diff) | |
download | bcm5719-llvm-4526b1d410a3d6d5571ddd27e2531aad13ca6093.tar.gz bcm5719-llvm-4526b1d410a3d6d5571ddd27e2531aad13ca6093.zip |
Add a version of unique_file that return just the file name.
llvm-svn: 184206
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index 3af551f43dd..43f2d3318ae 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -34,12 +34,6 @@ #include <fstream> -#if !defined(_MSC_VER) && !defined(__MINGW32__) -#include <unistd.h> -#else -#include <io.h> -#endif - using namespace llvm; namespace llvm { @@ -130,16 +124,14 @@ bool BugDriver::runPasses(Module *Program, // setup the output file name outs().flush(); SmallString<128> UniqueFilename; - int UniqueFD; - error_code EC = sys::fs::unique_file(OutputPrefix + "-output-%%%%%%%.bc", - UniqueFD, UniqueFilename); + error_code EC = + sys::fs::unique_file(OutputPrefix + "-output-%%%%%%%.bc", UniqueFilename); if (EC) { errs() << getToolName() << ": Error making unique filename: " << EC.message() << "\n"; return 1; } OutputFilename = UniqueFilename.str(); - close(UniqueFD); // We only want the filename. // set up the input file name SmallString<128> InputFilename; |