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

Rafael Espindola rafael.espindola at gmail.com
Tue Jun 25 07:48:01 PDT 2013


Author: rafael
Date: Tue Jun 25 09:48:00 2013
New Revision: 184855

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

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

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=184855&r1=184854&r2=184855&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Jun 25 09:48:00 2013
@@ -346,10 +346,9 @@ void Clang::AddPreprocessingOptions(Comp
       bool FoundPTH = false;
       bool FoundPCH = false;
       llvm::sys::Path P(A->getValue());
-      bool Exists;
       if (UsePCH) {
         P.appendSuffix("pch");
-        if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
+        if (llvm::sys::fs::exists(P.str()))
           FoundPCH = true;
         else
           P.eraseSuffix();
@@ -357,7 +356,7 @@ void Clang::AddPreprocessingOptions(Comp
 
       if (!FoundPCH) {
         P.appendSuffix("pth");
-        if (!llvm::sys::fs::exists(P.str(), Exists) && Exists)
+        if (llvm::sys::fs::exists(P.str()))
           FoundPTH = true;
         else
           P.eraseSuffix();
@@ -365,7 +364,7 @@ void Clang::AddPreprocessingOptions(Comp
 
       if (!FoundPCH && !FoundPTH) {
         P.appendSuffix("gch");
-        if (!llvm::sys::fs::exists(P.str(), Exists) && Exists) {
+        if (llvm::sys::fs::exists(P.str())) {
           FoundPCH = UsePCH;
           FoundPTH = !UsePCH;
         }
@@ -1635,8 +1634,7 @@ SanitizerArgs::SanitizerArgs(const ToolC
                                    options::OPT_fno_sanitize_blacklist)) {
     if (BLArg->getOption().matches(options::OPT_fsanitize_blacklist)) {
       std::string BLPath = BLArg->getValue();
-      bool BLExists = false;
-      if (!llvm::sys::fs::exists(BLPath, BLExists) && BLExists)
+      if (llvm::sys::fs::exists(BLPath))
         BlacklistFile = BLPath;
       else
         D.Diag(diag::err_drv_no_such_file) << BLPath;
@@ -1645,9 +1643,8 @@ SanitizerArgs::SanitizerArgs(const ToolC
     // If no -fsanitize-blacklist option is specified, try to look up for
     // blacklist in the resource directory.
     std::string BLPath;
-    bool BLExists = false;
     if (getDefaultBlacklistForKind(D, Kind, BLPath) &&
-        !llvm::sys::fs::exists(BLPath, BLExists) && BLExists)
+        llvm::sys::fs::exists(BLPath))
       BlacklistFile = BLPath;
   }
 





More information about the cfe-commits mailing list