diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-29 21:26:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-29 21:26:49 +0000 |
commit | 7f822a9306f2818f9cbb020e96f97ce9b97dbc9a (patch) | |
tree | b8707194402ac2ce3a440c4fb2fddc5275e3b68f /llvm/lib/Support/Unix | |
parent | 64fad60e34f7a2cd4b497f7cc496ee1728b2bfc6 (diff) | |
download | bcm5719-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/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 5386366b542..0c4518c7493 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -293,6 +293,10 @@ TimeValue file_status::getLastModificationTime() const { return Ret; } +UniqueID file_status::getUniqueID() { + return UniqueID(fs_st_dev, fs_st_ino); +} + error_code current_path(SmallVectorImpl<char> &result) { #ifdef MAXPATHLEN result.reserve(MAXPATHLEN); @@ -457,18 +461,6 @@ error_code equivalent(const Twine &A, const Twine &B, bool &result) { return error_code::success(); } -error_code getUniqueID(const Twine Path, uint64_t &Result) { - SmallString<128> Storage; - StringRef P = Path.toNullTerminatedStringRef(Storage); - - struct stat Status; - if (::stat(P.begin(), &Status) != 0) - return error_code(errno, system_category()); - - Result = Status.st_ino; - return error_code::success(); -} - static error_code fillStatus(int StatRet, const struct stat &Status, file_status &Result) { if (StatRet != 0) { |