From 7d86ee5ab0ca98edff2f07c373967f34227c960e Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 8 Mar 2017 17:56:08 +0000 Subject: 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 --- llvm/lib/Support/Path.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'llvm/lib/Support/Path.cpp') 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) && -- cgit v1.2.3