Use the simpler sys::fs::exists.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 20 Jun 2013 12:04:39 +0000 (12:04 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 20 Jun 2013 12:04:39 +0000 (12:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184413 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-ar/ArchiveWriter.cpp

index ada45f510ba732e775b43024a94593b27d7994db..3656ad4854c97e9a3cb808f98afd622e38c91ae7 100644 (file)
@@ -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;