aboutsummaryrefslogtreecommitdiff
path: root/lib/Archive/Archive.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-10 02:34:23 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-10 02:34:23 +0000
commit54453f2978c76b3aa71be7bb4e9657c8539f8648 (patch)
tree007baedd6ba7bd7752feb8443472dd84cdea43cb /lib/Archive/Archive.cpp
parentf4afaa81f2d1736a4115a22c96d8188178f11cfc (diff)
Support/Path: Deprecate PathV1::exists and replace all uses with PathV2::fs::exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r--lib/Archive/Archive.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 20d9deec99..8aa5d5bd77 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -15,6 +15,7 @@
#include "ArchiveInternals.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Module.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/system_error.h"
@@ -66,8 +67,9 @@ ArchiveMember::ArchiveMember(Archive* PAR)
// different file, presumably as an update to the member. It also makes sure
// the flags are reset correctly.
bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
- if (!newFile.exists()) {
- if (ErrMsg)
+ bool Exists;
+ if (sys::fs::exists(newFile.str(), Exists) || !Exists) {
+ if (ErrMsg)
*ErrMsg = "Can not replace an archive member with a non-existent file";
return true;
}