Make FileEntry::closeFile public

If you request that the file manager not close your file immediately
after reading, it's useful to be able to close it later to prevent a
file descriptor leak.

llvm-svn: 228407
This commit is contained in:
Ben Langmuir 2015-02-06 17:34:28 +00:00
parent 96d5dc77fa
commit 79fdb75a34
1 changed files with 4 additions and 4 deletions

View File

@ -73,10 +73,6 @@ class FileEntry {
mutable std::unique_ptr<vfs::File> File;
friend class FileManager;
void closeFile() const {
File.reset(); // rely on destructor to close File
}
void operator=(const FileEntry &) LLVM_DELETED_FUNCTION;
public:
@ -109,6 +105,10 @@ public:
/// \brief Check whether the file is a named pipe (and thus can't be opened by
/// the native FileManager methods).
bool isNamedPipe() const { return IsNamedPipe; }
void closeFile() const {
File.reset(); // rely on destructor to close File
}
};
struct FileData;