summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-05-15 22:07:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-05-15 22:07:14 +0000
commitcce6248edea1215bf53f4bd8261b62f68e6db1ca (patch)
treeb8699ee4f0570de29dad6d2a69ab229acb311585 /llvm
parent18e9ac79146bd6740b92472d73aa252db314e83b (diff)
downloadbcm5719-llvm-cce6248edea1215bf53f4bd8261b62f68e6db1ca.tar.gz
bcm5719-llvm-cce6248edea1215bf53f4bd8261b62f68e6db1ca.zip
[Support] Add a version of sys::fs::equivalent() that treats errors as false.
llvm-svn: 156864
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/FileSystem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
index 55565cd639a..4bee20549cd 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -309,6 +309,13 @@ bool equivalent(file_status A, file_status B);
/// platform specific error_code.
error_code equivalent(const Twine &A, const Twine &B, bool &result);
+/// @brief Simpler version of equivalent for clients that don't need to
+/// differentiate between an error and false.
+inline bool equivalent(const Twine &A, const Twine &B) {
+ bool result;
+ return !equivalent(A, B, result) && result;
+}
+
/// @brief Get file size.
///
/// @param path Input path.
OpenPOWER on IntegriCloud