diff options
| author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-01-10 02:34:23 +0000 |
|---|---|---|
| committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-01-10 02:34:23 +0000 |
| commit | 58df2e00b244b172ee6902d301607b94783579cf (patch) | |
| tree | d2c572d69668db747b45c0a3c652f369fea397f6 /llvm/lib/Archive | |
| parent | f6efe58d4585e7fd0b20bac44c3bc027502da121 (diff) | |
| download | bcm5719-llvm-58df2e00b244b172ee6902d301607b94783579cf.tar.gz bcm5719-llvm-58df2e00b244b172ee6902d301607b94783579cf.zip | |
Support/Path: Deprecate PathV1::exists and replace all uses with PathV2::fs::exists.
llvm-svn: 123151
Diffstat (limited to 'llvm/lib/Archive')
| -rw-r--r-- | llvm/lib/Archive/Archive.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Archive/ArchiveWriter.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Archive/Archive.cpp b/llvm/lib/Archive/Archive.cpp index 20d9deec99c..8aa5d5bd779 100644 --- a/llvm/lib/Archive/Archive.cpp +++ b/llvm/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; } diff --git a/llvm/lib/Archive/ArchiveWriter.cpp b/llvm/lib/Archive/ArchiveWriter.cpp index 07516c6aa45..7499a22878e 100644 --- a/llvm/lib/Archive/ArchiveWriter.cpp +++ b/llvm/lib/Archive/ArchiveWriter.cpp @@ -15,6 +15,7 @@ #include "llvm/Module.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" @@ -156,7 +157,8 @@ Archive::fillHeader(const ArchiveMember &mbr, ArchiveMemberHeader& hdr, bool Archive::addFileBefore(const sys::Path& filePath, iterator where, std::string* ErrMsg) { - if (!filePath.exists()) { + bool Exists; + if (sys::fs::exists(filePath.str(), Exists) || !Exists) { if (ErrMsg) *ErrMsg = "Can not add a non-existent file to archive"; return true; |

