Print error messages from MemoryBuffer::getFile() in llvm-symbolizer
authorAlexey Samsonov <samsonov@google.com>
Tue, 5 Feb 2013 07:01:34 +0000 (07:01 +0000)
committerAlexey Samsonov <samsonov@google.com>
Tue, 5 Feb 2013 07:01:34 +0000 (07:01 +0000)
llvm-svn: 174346

llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp

index 42e76f8..227580f 100644 (file)
@@ -181,7 +181,8 @@ static bool getObjectEndianness(const ObjectFile *Obj,
 
 static ObjectFile *getObjectFile(const std::string &Path) {
   OwningPtr<MemoryBuffer> Buff;
-  MemoryBuffer::getFile(Path, Buff);
+  if (error_code ec = MemoryBuffer::getFile(Path, Buff))
+    error(ec);
   return ObjectFile::createObjectFile(Buff.take());
 }