summaryrefslogtreecommitdiff
path: root/tools/llvm-symbolizer
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-15 04:49:50 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-15 04:49:50 +0000
commit27a41c154721b38f0192d9bd2e1d90e43f5083e4 (patch)
treeb4549550f815bfbb4b6d6dfea96c96de8a6a8323 /tools/llvm-symbolizer
parente96fec2e436003714a6bf3739d594d77701da1e5 (diff)
downloadllvm-27a41c154721b38f0192d9bd2e1d90e43f5083e4.tar.gz
llvm-27a41c154721b38f0192d9bd2e1d90e43f5083e4.tar.bz2
llvm-27a41c154721b38f0192d9bd2e1d90e43f5083e4.tar.xz
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
Diffstat (limited to 'tools/llvm-symbolizer')
-rw-r--r--tools/llvm-symbolizer/LLVMSymbolize.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp
index 0e6e80a21b..751453c27f 100644
--- a/tools/llvm-symbolizer/LLVMSymbolize.cpp
+++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp
@@ -312,10 +312,8 @@ LLVMSymbolizer::getOrCreateBinary(const std::string &Path) {
// 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);
}