diff options
author | Zachary Turner <zturner@google.com> | 2017-03-08 17:56:08 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-03-08 17:56:08 +0000 |
commit | 7d86ee5ab0ca98edff2f07c373967f34227c960e (patch) | |
tree | 622b630eca7be4ea6b604c8eacc956031dbb8ee9 /llvm/lib/Support/Path.cpp | |
parent | 5c13623a69baed43b7f0cbf2912a3baa951285e2 (diff) | |
download | bcm5719-llvm-7d86ee5ab0ca98edff2f07c373967f34227c960e.tar.gz bcm5719-llvm-7d86ee5ab0ca98edff2f07c373967f34227c960e.zip |
Resubmit FileSystem changes.
This was originall reverted due to some test failures in
ModuleCache and TestCompDirSymlink. These issues have all
been resolved and the code now passes all tests.
Differential Revision: https://reviews.llvm.org/D30698
llvm-svn: 297300
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 3eee85fc3f7..11fa3c3e1a6 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -984,6 +984,18 @@ std::error_code is_regular_file(const Twine &path, bool &result) { return std::error_code(); } +bool is_symlink_file(file_status status) { + return status.type() == file_type::symlink_file; +} + +std::error_code is_symlink_file(const Twine &path, bool &result) { + file_status st; + if (std::error_code ec = status(path, st, false)) + return ec; + result = is_symlink_file(st); + return std::error_code(); +} + bool is_other(file_status status) { return exists(status) && !is_regular_file(status) && |