aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-ranlib/llvm-ranlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-ranlib/llvm-ranlib.cpp')
-rw-r--r--tools/llvm-ranlib/llvm-ranlib.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-ranlib/llvm-ranlib.cpp b/tools/llvm-ranlib/llvm-ranlib.cpp
index 7f94c2413d..64f795f7f6 100644
--- a/tools/llvm-ranlib/llvm-ranlib.cpp
+++ b/tools/llvm-ranlib/llvm-ranlib.cpp
@@ -15,6 +15,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"
@@ -69,7 +70,8 @@ int main(int argc, char **argv) {
throw std::string("Archive name invalid: ") + ArchiveName;
// Make sure it exists, we don't create empty archives
- if (!ArchivePath.exists())
+ bool Exists;
+ if (llvm::sys::fs::exists(ArchivePath.str(), Exists) || !Exists)
throw std::string("Archive file does not exist");
std::string err_msg;