summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-07 03:43:17 +0000
committerZachary Turner <zturner@google.com>2017-03-07 03:43:17 +0000
commit990e3cd8e25970e477840d81972290858caffd50 (patch)
tree50278a2ce428ac02066aa7611cbe42cc89b11e6e /llvm/lib/Support/Path.cpp
parent06ec03c2110e1a17271699a95ba28b0a56d9e17b (diff)
downloadbcm5719-llvm-990e3cd8e25970e477840d81972290858caffd50.tar.gz
bcm5719-llvm-990e3cd8e25970e477840d81972290858caffd50.zip
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 llvm-svn: 297116
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index 0709ec272f5..94ed1876bbd 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -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;
}
OpenPOWER on IntegriCloud