diff options
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 4c986715ae..e422f310c6 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/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 { |