aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-24 17:54:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-24 17:54:24 +0000
commit89ced61187bc9805f2894f5988c07d12531a3a0e (patch)
tree1d4e8393ea348e7a501162a1cb10359d05199aa9 /include
parent8de0a465b832052d975dc9fdced1adcf3336fabc (diff)
downloadexternal_llvm-89ced61187bc9805f2894f5988c07d12531a3a0e.zip
external_llvm-89ced61187bc9805f2894f5988c07d12531a3a0e.tar.gz
external_llvm-89ced61187bc9805f2894f5988c07d12531a3a0e.tar.bz2
Add a simpler version of is_regular_file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/FileSystem.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h
index 474e01c..5c514dc 100644
--- a/include/llvm/Support/FileSystem.h
+++ b/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?
///