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 | 54453f2978c76b3aa71be7bb4e9657c8539f8648 (patch) | |
tree | 007baedd6ba7bd7752feb8443472dd84cdea43cb /tools/llvm-ar/llvm-ar.cpp | |
parent | f4afaa81f2d1736a4115a22c96d8188178f11cfc (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 'tools/llvm-ar/llvm-ar.cpp')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 3271f7c82f..4fbd3bcbd9 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -16,6 +16,7 @@ #include "llvm/Module.h" #include "llvm/Bitcode/Archive.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Format.h" @@ -310,7 +311,8 @@ bool buildPaths(bool checkExistence, std::string* ErrMsg) { if (!aPath.set(Members[i])) throw std::string("File member name invalid: ") + Members[i]; if (checkExistence) { - if (!aPath.exists()) + bool Exists; + if (sys::fs::exists(aPath.str(), Exists) || !Exists) throw std::string("File does not exist: ") + Members[i]; std::string Err; sys::PathWithStatus PwS(aPath); @@ -715,7 +717,8 @@ int main(int argc, char **argv) { throw std::string("Archive name invalid: ") + ArchiveName; // Create or open the archive object. - if (!ArchivePath.exists()) { + bool Exists; + if (llvm::sys::fs::exists(ArchivePath.str(), Exists) || !Exists) { // Produce a warning if we should and we're creating the archive if (!Create) errs() << argv[0] << ": creating " << ArchivePath.str() << "\n"; |