llvm.org GIT mirror llvm / 27a41c1
Check the error code and save a call to sys::fs::exists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199293 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
1 changed file(s) with 2 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
311311 // resource directory.
312312 const std::string &ResourcePath =
313313 getDarwinDWARFResourceForPath(Path);
314 bool ResourceFileExists = false;
315 if (!sys::fs::exists(ResourcePath, ResourceFileExists) &&
316 ResourceFileExists &&
317 !error(createBinary(ResourcePath, ParsedDbgBinary))) {
314 error_code EC = createBinary(ResourcePath, ParsedDbgBinary);
315 if (EC != errc::no_such_file_or_directory && !error(EC)) {
318316 DbgBin = ParsedDbgBinary.take();
319317 ParsedBinariesAndObjects.push_back(DbgBin);
320318 }