summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/PathV1.h3
-rw-r--r--llvm/lib/Support/PathV2.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/PathV1.h b/llvm/include/llvm/Support/PathV1.h
index 0b8a4647131..a1c3f6a49a1 100644
--- a/llvm/include/llvm/Support/PathV1.h
+++ b/llvm/include/llvm/Support/PathV1.h
@@ -394,7 +394,8 @@ namespace sys {
/// existing symbolic link.
/// @returns true if the pathname references an existing symlink.
/// @brief Determines if the path is a symlink in the file system.
- bool isSymLink() const;
+ LLVM_ATTRIBUTE_DEPRECATED(bool isSymLink() const,
+ LLVM_PATH_DEPRECATED_MSG(fs::is_symlink));
/// This function determines if the path name references a readable file
/// or directory in the file system. This function checks for
diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp
index f2ca34b4adf..e2565d55f06 100644
--- a/llvm/lib/Support/PathV2.cpp
+++ b/llvm/lib/Support/PathV2.cpp
@@ -660,6 +660,14 @@ bool is_symlink(file_status status) {
return status.type() == file_type::symlink_file;
}
+error_code is_symlink(const Twine &path, bool &result) {
+ file_status st;
+ if (error_code ec = status(path, st))
+ return ec;
+ result = is_symlink(st);
+ return success;
+}
+
bool is_other(file_status status) {
return exists(status) &&
!is_regular_file(status) &&
OpenPOWER on IntegriCloud