summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-08 00:18:12 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-08 00:18:12 +0000
commitee8fc6a6225db2a90d80595513e1cb406aaa2152 (patch)
treef3225a81aa894595d56585b739e3fcfa4890d39c
parent159970f7337088ee5475669b43dd58d1cdabca95 (diff)
downloadbcm5719-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.h7
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.
OpenPOWER on IntegriCloud