[llvm] r199293 - Check the error code and save a call to sys::fs::exists.

Rafael Espindola rafael.espindola at gmail.com
Tue Jan 14 20:49:51 PST 2014


Author: rafael
Date: Tue Jan 14 22:49:50 2014
New Revision: 199293

URL: http://llvm.org/viewvc/llvm-project?rev=199293&view=rev
Log:
Check the error code and save a call to sys::fs::exists.

Modified:
    llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp

Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp?rev=199293&r1=199292&r2=199293&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp Tue Jan 14 22:49:50 2014
@@ -312,10 +312,8 @@ LLVMSymbolizer::getOrCreateBinary(const
       // resource directory.
       const std::string &ResourcePath =
           getDarwinDWARFResourceForPath(Path);
-      bool ResourceFileExists = false;
-      if (!sys::fs::exists(ResourcePath, ResourceFileExists) &&
-          ResourceFileExists &&
-          !error(createBinary(ResourcePath, ParsedDbgBinary))) {
+      error_code EC = createBinary(ResourcePath, ParsedDbgBinary);
+      if (EC != errc::no_such_file_or_directory && !error(EC)) {
         DbgBin = ParsedDbgBinary.take();
         ParsedBinariesAndObjects.push_back(DbgBin);
       }





More information about the llvm-commits mailing list