diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-05-15 22:07:14 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-05-15 22:07:14 +0000 |
commit | 719daba3e01531c6947f07d351550e7ec0a3f0b9 (patch) | |
tree | b868567fabcc0da3128d906a50b59502324d7661 /include/llvm | |
parent | 89e369ad61e4a144d264ee199d7819237fc99841 (diff) | |
download | external_llvm-719daba3e01531c6947f07d351550e7ec0a3f0b9.zip external_llvm-719daba3e01531c6947f07d351550e7ec0a3f0b9.tar.gz external_llvm-719daba3e01531c6947f07d351550e7ec0a3f0b9.tar.bz2 |
[Support] Add a version of sys::fs::equivalent() that treats errors as false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/FileSystem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index 55565cd..4bee205 100644 --- a/include/llvm/Support/FileSystem.h +++ b/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. |