Add simpler version of is_directory. It will be used in clang.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 17 Jul 2013 04:20:49 +0000 (04:20 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 17 Jul 2013 04:20:49 +0000 (04:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186486 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FileSystem.h

index 800f4ebe7a32a581d4d6d6651b5033808a5e69da..f3f76768f3b58d9dfb337e9d6ae63deb63acd8b9 100644 (file)
@@ -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.