OSDN Git Service

PathV2: Add simplified version of exists that returns false on error.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Sat, 8 Oct 2011 00:18:12 +0000 (00:18 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Sat, 8 Oct 2011 00:18:12 +0000 (00:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141450 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FileSystem.h

index e52306b..a868e5f 100644 (file)
@@ -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.