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 | 904165fc7ce3e886caaea9f3141358d4308560c9 (patch) | |
| tree | d838ce59ff4c4f17b1cb5d584d82a9d438de47e3 | |
| parent | 24048c9440773f1e8a22b9409720eb08b721d8af (diff) | |
| download | bcm5719-llvm-904165fc7ce3e886caaea9f3141358d4308560c9.tar.gz bcm5719-llvm-904165fc7ce3e886caaea9f3141358d4308560c9.zip | |
Add simpler version of is_directory. It will be used in clang.
llvm-svn: 186486
| -rw-r--r-- | llvm/include/llvm/Support/FileSystem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h index 800f4ebe7a3..f3f76768f3b 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. |

