summaryrefslogtreecommitdiff
path: root/include/llvm/Support/FileSystem.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-27 03:45:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-27 03:45:31 +0000
commit08ddd12e444880b4d570ac42a42414a227022190 (patch)
treed47e948fb007aea27ccdfd68c38dd88a2df19026 /include/llvm/Support/FileSystem.h
parente2b9912a7877d0c73e0c5863ae2ea668edca1de4 (diff)
downloadllvm-08ddd12e444880b4d570ac42a42414a227022190.tar.gz
llvm-08ddd12e444880b4d570ac42a42414a227022190.tar.bz2
llvm-08ddd12e444880b4d570ac42a42414a227022190.tar.xz
Add a convenience createUniqueDirectory function.
There are a few valid situation where we care about the structure inside a directory, but not about the directory itself. A simple example is for unit testing directory traversal. PathV1 had a function like this, add one to V2 and port existing users of the created temp file and delete it hack to using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/FileSystem.h')
-rw-r--r--include/llvm/Support/FileSystem.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h
index b72192753c..ac46117f27 100644
--- a/include/llvm/Support/FileSystem.h
+++ b/include/llvm/Support/FileSystem.h
@@ -568,11 +568,16 @@ error_code status_known(const Twine &path, bool &result);
/// otherwise a platform specific error_code.
error_code unique_file(const Twine &model, int &result_fd,
SmallVectorImpl<char> &result_path,
- bool makeAbsolute = true, unsigned mode = owner_read | owner_write);
+ bool makeAbsolute = true,
+ unsigned mode = owner_read | owner_write);
/// @brief Simpler version for clients that don't want an open file.
error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
- bool MakeAbsolute = true, unsigned Mode = owner_read | owner_write);
+ bool MakeAbsolute = true,
+ unsigned Mode = owner_read | owner_write);
+
+error_code createUniqueDirectory(const Twine &Prefix,
+ SmallVectorImpl<char> &ResultPath);
/// @brief Canonicalize path.
///