#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/PathV1.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#include <fstream>
// Rerun the compiler, capturing any error messages to print them.
SmallString<128> ErrorFilename;
int ErrorFD;
- error_code EC = sys::fs::unique_file("bugpoint.program_error_messages",
- ErrorFD, ErrorFilename);
+ error_code EC = sys::fs::createTemporaryFile(
+ "bugpoint.program_error_messages", "", ErrorFD, ErrorFilename);
if (EC) {
errs() << "Error making unique filename: " << EC.message() << "\n";
exit(1);
// Check the directory that the calling program is in. We can do
// this if ProgramPath contains at least one / character, indicating that it
// is a relative path to the executable itself.
- sys::Path Main = sys::Path::GetMainExecutable(Argv0, MainAddr);
- StringRef Result = sys::path::parent_path(Main.str());
+ std::string Main = sys::fs::getMainExecutable(Argv0, MainAddr);
+ StringRef Result = sys::path::parent_path(Main);
if (!Result.empty()) {
SmallString<128> Storage = Result;
SmallString<128> UniqueFile;
error_code EC =
- sys::fs::unique_file(Bitcode + "-%%%%%%%" + Suffix, UniqueFile);
+ sys::fs::createUniqueFile(Bitcode + "-%%%%%%%" + Suffix, UniqueFile);
if (EC) {
errs() << "Error making unique filename: " << EC.message() << "\n";
exit(1);
SmallString<128> OutputBinary;
error_code EC =
- sys::fs::unique_file(ProgramFile+ "-%%%%%%%.gcc.exe", OutputBinary);
+ sys::fs::createUniqueFile(ProgramFile + "-%%%%%%%.gcc.exe", OutputBinary);
if (EC) {
errs() << "Error making unique filename: " << EC.message() << "\n";
exit(1);
const std::vector<std::string> &ArgsForGCC,
std::string &Error) {
SmallString<128> UniqueFilename;
- error_code EC = sys::fs::unique_file(InputFile + "-%%%%%%%" + LTDL_SHLIB_EXT,
- UniqueFilename);
+ error_code EC = sys::fs::createUniqueFile(
+ InputFile + "-%%%%%%%" + LTDL_SHLIB_EXT, UniqueFilename);
if (EC) {
errs() << "Error making unique filename: " << EC.message() << "\n";
exit(1);