Add a version of unique_file that return just the file name.
[oota-llvm.git] / tools / bugpoint / ExecutionDriver.cpp
index 53908081287963bb8093eef7659d8bdd8837a231..6edf2335f6c5fa36e44a45d2be0a17c27f572d79 100644 (file)
 #include "llvm/Support/raw_ostream.h"
 #include <fstream>
 
-#if !defined(_MSC_VER) && !defined(__MINGW32__)
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
 using namespace llvm;
 
 namespace {
@@ -338,15 +332,13 @@ std::string BugDriver::executeProgram(const Module *Program,
 
   // Check to see if this is a valid output filename...
   SmallString<128> UniqueFile;
-  int UniqueFD;
-  error_code EC = sys::fs::unique_file(OutputFile, UniqueFD, UniqueFile);
+  error_code EC = sys::fs::unique_file(OutputFile, UniqueFile);
   if (EC) {
     errs() << ToolName << ": Error making unique filename: "
            << EC.message() << "\n";
     exit(1);
   }
   OutputFile = UniqueFile.str();
-  close(UniqueFD);
 
   // Figure out which shared objects to run, if any.
   std::vector<std::string> SharedObjs(AdditionalSOs);