diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 18:42:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 18:42:04 +0000 |
commit | db5d8feeead5b191051e2f4703952a004a19768a (patch) | |
tree | 82b6a7de78b8d2799b8994196b92ef525ca53c16 /llvm/tools/llvm-ar/llvm-ar.cpp | |
parent | 120c9288258be97a57c057aa1f9539f2a406bae7 (diff) | |
download | bcm5719-llvm-db5d8feeead5b191051e2f4703952a004a19768a.tar.gz bcm5719-llvm-db5d8feeead5b191051e2f4703952a004a19768a.zip |
Add support for getting the last modification time from a file_status.
Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus.
llvm-svn: 184450
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r-- | llvm/tools/llvm-ar/llvm-ar.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 4c986715aec..e422f310c6b 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -583,15 +583,14 @@ doReplaceOrInsert(std::string* ErrMsg) { } if (found != remaining.end()) { - std::string Err; - sys::PathWithStatus PwS(*found); - const sys::FileStatus *si = PwS.getFileStatus(false, &Err); - if (!si) + sys::fs::file_status Status; + error_code EC = sys::fs::status(*found, Status); + if (EC) return true; - if (!si->isDir) { + if (!sys::fs::is_directory(Status)) { if (OnlyUpdate) { // Replace the item only if it is newer. - if (si->modTime > I->getModTime()) + if (Status.getLastModificationTime() > I->getModTime()) if (I->replaceWith(*found, ErrMsg)) return true; } else { |