diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-24 17:54:24 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-24 17:54:24 +0000 |
| commit | eb23add2ad0426edabf8221f60627af086b7b980 (patch) | |
| tree | 6e9ad98ca0b67b678b3428cb01483635983ce52f | |
| parent | 8a36502a60326473ec187eaa954e47beab25a8fb (diff) | |
| download | bcm5719-llvm-eb23add2ad0426edabf8221f60627af086b7b980.tar.gz bcm5719-llvm-eb23add2ad0426edabf8221f60627af086b7b980.zip | |
Add a simpler version of is_regular_file.
llvm-svn: 184764
| -rw-r--r-- | llvm/include/llvm/Support/FileSystem.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h index 474e01ce360..5c514dc95c8 100644 --- a/llvm/include/llvm/Support/FileSystem.h +++ b/llvm/include/llvm/Support/FileSystem.h @@ -448,6 +448,15 @@ bool is_regular_file(file_status status); /// platform specific error_code. error_code is_regular_file(const Twine &path, bool &result); +/// @brief Simpler version of is_regular_file for clients that don't need to +/// differentiate between an error and false. +inline bool is_regular_file(const Twine &Path) { + bool Result; + if (is_regular_file(Path, Result)) + return false; + return Result; +} + /// @brief Does this status represent something that exists but is not a /// directory, regular file, or symlink? /// |

