r184770 - Use the simpler version of llvm::sys::fs::exists.

Rafael Espindola rafael.espindola at gmail.com
Mon Jun 24 11:19:15 PDT 2013


Author: rafael
Date: Mon Jun 24 13:19:15 2013
New Revision: 184770

URL: http://llvm.org/viewvc/llvm-project?rev=184770&view=rev
Log:
Use the simpler version of llvm::sys::fs::exists.

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=184770&r1=184769&r2=184770&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Jun 24 13:19:15 2013
@@ -977,8 +977,7 @@ void Driver::BuildInputs(const ToolChain
           }
         }
 
-        bool exists = false;
-        if (llvm::sys::fs::exists(Path.c_str(), exists) || !exists)
+        if (!llvm::sys::fs::exists(Twine(Path)))
           Diag(clang::diag::err_drv_no_such_file) << Path.str();
         else
           Inputs.push_back(std::make_pair(Ty, A));
@@ -1538,15 +1537,13 @@ std::string Driver::GetFilePath(const ch
       Dir = SysRoot + Dir.substr(1);
     llvm::sys::Path P(Dir);
     P.appendComponent(Name);
-    bool Exists;
-    if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
+    if (llvm::sys::fs::exists(P.str()))
       return P.str();
   }
 
   llvm::sys::Path P(ResourceDir);
   P.appendComponent(Name);
-  bool Exists;
-  if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
+  if (llvm::sys::fs::exists(P.str()))
     return P.str();
 
   const ToolChain::path_list &List = TC.getFilePaths();
@@ -1559,8 +1556,7 @@ std::string Driver::GetFilePath(const ch
       Dir = SysRoot + Dir.substr(1);
     llvm::sys::Path P(Dir);
     P.appendComponent(Name);
-    bool Exists;
-    if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
+    if (llvm::sys::fs::exists(P.str()))
       return P.str();
   }
 





More information about the cfe-commits mailing list