summaryrefslogtreecommitdiff
path: root/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-07-29 21:26:49 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-07-29 21:26:49 +0000
commit3ed45fe2be4356351942a2cfe9bd92e996d4fcad (patch)
treedb0f4e0ca1ab5bea02dd42f312770d37b539a1e7 /lib/Support/Path.cpp
parent096880b59008a44860edd0fcab1f55aa1363bdf5 (diff)
downloadllvm-3ed45fe2be4356351942a2cfe9bd92e996d4fcad.tar.gz
llvm-3ed45fe2be4356351942a2cfe9bd92e996d4fcad.tar.bz2
llvm-3ed45fe2be4356351942a2cfe9bd92e996d4fcad.tar.xz
Include st_dev to make the result of getUniqueID actually unique.
This will let us use getUniqueID instead of st_dev directly on clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Path.cpp')
-rw-r--r--lib/Support/Path.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp
index 6d10c0e67b..cfd9ed6db3 100644
--- a/lib/Support/Path.cpp
+++ b/lib/Support/Path.cpp
@@ -638,6 +638,15 @@ bool is_relative(const Twine &path) {
namespace fs {
+error_code getUniqueID(const Twine Path, UniqueID &Result) {
+ file_status Status;
+ error_code EC = status(Path, Status);
+ if (EC)
+ return EC;
+ Result = Status.getUniqueID();
+ return error_code::success();
+}
+
error_code createUniqueFile(const Twine &Model, int &ResultFd,
SmallVectorImpl<char> &ResultPath, unsigned Mode) {
return createUniqueEntity(Model, ResultFd, ResultPath, false, Mode, FS_File);