aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/FileSystem.h
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-08 00:18:12 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-08 00:18:12 +0000
commit880545e5d7ad80f0da09187459da1c8a2dcb34ef (patch)
tree7b2bd196c0fa29fceee879906c863208484aa76c /include/llvm/Support/FileSystem.h
parentc6500a5d77159e9c9a9f1f8f56307a0016f229a0 (diff)
PathV2: Add simplified version of exists that returns false on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/FileSystem.h')
-rw-r--r--include/llvm/Support/FileSystem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h
index e52306bd43..a868e5f9f7 100644
--- a/include/llvm/Support/FileSystem.h
+++ b/include/llvm/Support/FileSystem.h
@@ -221,6 +221,13 @@ bool exists(file_status status);
/// platform specific error_code.
error_code exists(const Twine &path, bool &result);
+/// @brief Simpler version of exists for clients that don't need to
+/// differentiate between an error and false.
+inline bool exists(const Twine &path) {
+ bool result;
+ return !exists(path, result) && result;
+}
+
/// @brief Do file_status's represent the same thing?
///
/// @param A Input file_status.