diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-10-08 00:18:12 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-10-08 00:18:12 +0000 |
commit | ee8fc6a6225db2a90d80595513e1cb406aaa2152 (patch) | |
tree | f3225a81aa894595d56585b739e3fcfa4890d39c | |
parent | 159970f7337088ee5475669b43dd58d1cdabca95 (diff) | |
download | bcm5719-llvm-ee8fc6a6225db2a90d80595513e1cb406aaa2152.tar.gz bcm5719-llvm-ee8fc6a6225db2a90d80595513e1cb406aaa2152.zip |
PathV2: Add simplified version of exists that returns false on error.
llvm-svn: 141450
-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 e52306bd436..a868e5f9f70 100644 --- a/llvm/include/llvm/Support/FileSystem.h +++ b/llvm/include/llvm/Support/FileSystem.h @@ -221,6 +221,13 @@ bool exists(file_status status); /// platform specific error_code. error_code exists(const Twine &path, bool &result); +/// @brief Simpler version of exists for clients that don't need to +/// differentiate between an error and false. +inline bool exists(const Twine &path) { + bool result; + return !exists(path, result) && result; +} + /// @brief Do file_status's represent the same thing? /// /// @param A Input file_status. |