summaryrefslogtreecommitdiff
path: root/lib/Support/PathV2.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-11 01:21:55 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-11 01:21:55 +0000
commit218dc3e2fe54c28b0292a3e89c5ed6563f62ac23 (patch)
tree14d22d940fea2720c93383a5f2dbda16488d2053 /lib/Support/PathV2.cpp
parent121704d738f9de8aaf04b144dcf493130fbfee3d (diff)
downloadllvm-218dc3e2fe54c28b0292a3e89c5ed6563f62ac23.tar.gz
llvm-218dc3e2fe54c28b0292a3e89c5ed6563f62ac23.tar.bz2
llvm-218dc3e2fe54c28b0292a3e89c5ed6563f62ac23.tar.xz
Support/Path: Deprecate PathV1::isDirectory and replace all uses with PathV2::is_directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/PathV2.cpp')
-rw-r--r--lib/Support/PathV2.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp
index 3b232abf7d..f2ca34b4ad 100644
--- a/lib/Support/PathV2.cpp
+++ b/lib/Support/PathV2.cpp
@@ -636,10 +636,26 @@ bool is_directory(file_status status) {
return status.type() == file_type::directory_file;
}
+error_code is_directory(const Twine &path, bool &result) {
+ file_status st;
+ if (error_code ec = status(path, st))
+ return ec;
+ result = is_directory(st);
+ return success;
+}
+
bool is_regular_file(file_status status) {
return status.type() == file_type::regular_file;
}
+error_code is_regular_file(const Twine &path, bool &result) {
+ file_status st;
+ if (error_code ec = status(path, st))
+ return ec;
+ result = is_regular_file(st);
+ return success;
+}
+
bool is_symlink(file_status status) {
return status.type() == file_type::symlink_file;
}