diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-17 04:20:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-17 04:20:49 +0000 |
commit | 09df10df0d6f327049a7f315f175ab77044e6aaa (patch) | |
tree | 3475a04e89934ebfe6db6a4d7e1c7512e03fefa5 /include | |
parent | 619850cb3161733e9284ff3bf9a68d1a3b76f0b4 (diff) | |
download | external_llvm-09df10df0d6f327049a7f315f175ab77044e6aaa.zip external_llvm-09df10df0d6f327049a7f315f175ab77044e6aaa.tar.gz external_llvm-09df10df0d6f327049a7f315f175ab77044e6aaa.tar.bz2 |
Add simpler version of is_directory. It will be used in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/FileSystem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index 800f4eb..f3f7676 100644 --- a/include/llvm/Support/FileSystem.h +++ b/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. |