mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user