mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 06:00:28 +00:00
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:
parent
be4e5b13c4
commit
d9bfb7ba0c
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user