summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit7f822a9306f2818f9cbb020e96f97ce9b97dbc9a (patch)
treeb8707194402ac2ce3a440c4fb2fddc5275e3b68f /llvm/lib/Support/Path.cpp
parent64fad60e34f7a2cd4b497f7cc496ee1728b2bfc6 (diff)
downloadbcm5719-llvm-7f822a9306f2818f9cbb020e96f97ce9b97dbc9a.tar.gz
bcm5719-llvm-7f822a9306f2818f9cbb020e96f97ce9b97dbc9a.zip
Include st_dev to make the result of getUniqueID actually unique.
This will let us use getUniqueID instead of st_dev directly on clang. llvm-svn: 187378
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index 6d10c0e67bb..cfd9ed6db3d 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud