LLVM
8.0.1
|
Represents a temporary file. More...
#include "llvm/Support/FileSystem.h"
Public Member Functions | |
TempFile (TempFile &&Other) | |
TempFile & | operator= (TempFile &&Other) |
Error | keep (const Twine &Name) |
Error | keep () |
Error | discard () |
~TempFile () | |
Static Public Member Functions | |
static Expected< TempFile > | create (const Twine &Model, unsigned Mode=all_read|all_write) |
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal. More... | |
Public Attributes | |
std::string | TmpName |
int | FD = -1 |
Represents a temporary file.
The temporary file must be eventually discarded or given a final name and kept.
The destructor doesn't implicitly discard because there is no way to properly handle errors in a destructor.
Definition at line 806 of file FileSystem.h.
llvm::sys::fs::TempFile::TempFile | ( | TempFile && | Other | ) |
llvm::sys::fs::TempFile::~TempFile | ( | ) |
|
static |
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal.
Definition at line 1222 of file Path.cpp.
References llvm::consumeError(), llvm::sys::fs::createUniqueFile(), discard(), llvm::errorCodeToError(), llvm::sys::fs::OF_Delete, llvm::operation_not_permitted, llvm::sys::RemoveFileOnSignal(), and llvm::MipsISD::Ret.
Referenced by createOnDiskBuffer(), llvm::lto::localCache(), and llvm::writeArchive().
Error llvm::sys::fs::TempFile::discard | ( | ) |
Definition at line 1130 of file Path.cpp.
References llvm::sys::DontRemoveFileOnSignal(), llvm::errorCodeToError(), and llvm::sys::fs::remove().
Referenced by create(), createOnDiskBuffer(), and llvm::lto::localCache().
Definition at line 1154 of file Path.cpp.
References assert(), llvm::sys::fs::copy_file(), llvm::sys::DontRemoveFileOnSignal(), llvm::errorCodeToError(), H, and rename().
Referenced by llvm::lto::localCache().
Error llvm::sys::fs::TempFile::keep | ( | ) |
Definition at line 1199 of file Path.cpp.
References assert(), llvm::sys::DontRemoveFileOnSignal(), llvm::errorCodeToError(), H, and llvm::Error::success().
int llvm::sys::fs::TempFile::FD = -1 |
Definition at line 822 of file FileSystem.h.
Referenced by createOnDiskBuffer(), and llvm::lto::localCache().
std::string llvm::sys::fs::TempFile::TmpName |
Definition at line 819 of file FileSystem.h.
Referenced by llvm::lto::localCache().