From: Rafael Espindola Date: Wed, 17 Jul 2013 04:20:49 +0000 (+0000) Subject: Add simpler version of is_directory. It will be used in clang. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=904165fc7ce3e886caaea9f3141358d4308560c9;p=platform%2Fupstream%2Fllvm.git Add simpler version of is_directory. It will be used in clang. llvm-svn: 186486 --- diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h index 800f4eb..f3f7676 100644 --- a/llvm/include/llvm/Support/FileSystem.h +++ b/llvm/include/llvm/Support/FileSystem.h @@ -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.