Use LLVM for all stat-related functionality.

This deletes LLDB's FileType enumeration and replaces all
users, and all calls to functions that check whether a file
exists etc with corresponding calls to LLVM.

Differential Revision: https://reviews.llvm.org/D30624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner 2017-03-07 03:43:17 +00:00
parent be4e5b13c4
commit d9bfb7ba0c
2 changed files with 13 additions and 0 deletions

View File

@ -479,6 +479,12 @@ inline bool is_local(int FD) {
return !is_local(FD, Result) && Result;
}
/// @brief Does status represent a directory?
///
/// @param status A file_status previously returned from status.
/// @returns status.type() == file_type::directory_file.
file_type get_file_type(const Twine &Path);
/// @brief Does status represent a directory?
///
/// @param status A file_status previously returned from status.

View File

@ -953,6 +953,13 @@ bool status_known(file_status s) {
return s.type() != file_type::status_error;
}
file_type get_file_type(const Twine &Path) {
file_status st;
if (status(Path, st))
return file_type::status_error;
return st.type();
}
bool is_directory(file_status status) {
return status.type() == file_type::directory_file;
}