[llvm] r184955 - Add a convenience functions that don't return if the directory existed.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jun 26 08:21:14 PDT 2013
Author: rafael
Date: Wed Jun 26 10:21:13 2013
New Revision: 184955
URL: http://llvm.org/viewvc/llvm-project?rev=184955&view=rev
Log:
Add a convenience functions that don't return if the directory existed.
Modified:
llvm/trunk/include/llvm/Support/FileSystem.h
Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=184955&r1=184954&r2=184955&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Wed Jun 26 10:21:13 2013
@@ -271,6 +271,13 @@ error_code copy_file(const Twine &from,
/// otherwise a platform specific error_code.
error_code create_directories(const Twine &path, bool &existed);
+/// @brief Convenience function for clients that don't need to know if the
+/// directory existed or not.
+inline error_code create_directories(const Twine &Path) {
+ bool Existed;
+ return create_directories(Path, Existed);
+}
+
/// @brief Create the directory in path.
///
/// @param path Directory to create.
@@ -279,6 +286,13 @@ error_code create_directories(const Twin
/// otherwise a platform specific error_code.
error_code create_directory(const Twine &path, bool &existed);
+/// @brief Convenience function for clients that don't need to know if the
+/// directory existed or not.
+inline error_code create_directory(const Twine &Path) {
+ bool Existed;
+ return create_directory(Path, Existed);
+}
+
/// @brief Create a hard link from \a from to \a to.
///
/// @param to The path to hard link to.
More information about the llvm-commits
mailing list