[llvm-commits] [llvm] r141450 - /llvm/trunk/include/llvm/Support/FileSystem.h

Michael J. Spencer bigcheesegs at gmail.com
Fri Oct 7 17:18:12 PDT 2011


Author: mspencer
Date: Fri Oct  7 19:18:12 2011
New Revision: 141450

URL: http://llvm.org/viewvc/llvm-project?rev=141450&view=rev
Log:
PathV2: Add simplified version of exists that returns false on error.

Modified:
    llvm/trunk/include/llvm/Support/FileSystem.h

Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=141450&r1=141449&r2=141450&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Fri Oct  7 19:18:12 2011
@@ -221,6 +221,13 @@
 ///          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.





More information about the llvm-commits mailing list