diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index d051c03db304..b14df9af64f4 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -58,7 +58,7 @@ ObjectFile *ObjectFile::createObjectFile(MemoryBuffer *Object) { ObjectFile *ObjectFile::createObjectFile(StringRef ObjectPath) { OwningPtr File; - if (error_code ec = MemoryBuffer::getFile(ObjectPath, File)) + if (MemoryBuffer::getFile(ObjectPath, File)) return NULL; return createObjectFile(File.take()); } diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 3e159c75f411..13356f81b80e 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -335,7 +335,7 @@ static void DumpSymbolNamesFromFile(std::string &Filename) { for (object::Archive::child_iterator i = a->begin_children(), e = a->end_children(); i != e; ++i) { OwningPtr child; - if (error_code ec = i->getAsBinary(child)) { + if (i->getAsBinary(child)) { // Try opening it as a bitcode file. OwningPtr buff(i->getBuffer()); Module *Result = 0;