summaryrefslogtreecommitdiff
path: root/tools/llvm-ar/ArchiveWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-ar/ArchiveWriter.cpp')
-rw-r--r--tools/llvm-ar/ArchiveWriter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/llvm-ar/ArchiveWriter.cpp b/tools/llvm-ar/ArchiveWriter.cpp
index ada45f510b..3656ad4854 100644
--- a/tools/llvm-ar/ArchiveWriter.cpp
+++ b/tools/llvm-ar/ArchiveWriter.cpp
@@ -156,8 +156,7 @@ Archive::fillHeader(const ArchiveMember &mbr, ArchiveMemberHeader& hdr,
// of extracting the necessary flags and information from the file.
bool Archive::addFileBefore(StringRef filePath, iterator where,
std::string *ErrMsg) {
- bool Exists;
- if (sys::fs::exists(filePath.str(), Exists) || !Exists) {
+ if (!sys::fs::exists(filePath)) {
if (ErrMsg)
*ErrMsg = "Can not add a non-existent file to archive";
return true;