[llvm] r186486 - Add simpler version of is_directory. It will be used in clang.

Rafael Espindola rafael.espindola at gmail.com
Tue Jul 16 21:20:50 PDT 2013


Author: rafael
Date: Tue Jul 16 23:20:49 2013
New Revision: 186486

URL: http://llvm.org/viewvc/llvm-project?rev=186486&view=rev
Log:
Add simpler version of is_directory. It will be used in clang.

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=186486&r1=186485&r2=186486&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Tue Jul 16 23:20:49 2013
@@ -464,6 +464,13 @@ bool is_directory(file_status status);
 ///          platform specific error_code.
 error_code is_directory(const Twine &path, bool &result);
 
+/// @brief Simpler version of is_directory for clients that don't need to
+///        differentiate between an error and false.
+inline bool is_directory(const Twine &Path) {
+  bool Result;
+  return !is_directory(Path, Result) && Result;
+}
+
 /// @brief Does status represent a regular file?
 ///
 /// @param status A file_status previously returned from status.





More information about the llvm-commits mailing list