[lld] r266232 - Fix warning about unused variable.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 13 12:09:48 PDT 2016
Author: rafael
Date: Wed Apr 13 14:09:48 2016
New Revision: 266232
URL: http://llvm.org/viewvc/llvm-project?rev=266232&view=rev
Log:
Fix warning about unused variable.
Modified:
lld/trunk/ELF/Driver.cpp
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=266232&r1=266231&r2=266232&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Apr 13 14:09:48 2016
@@ -135,10 +135,9 @@ void LinkerDriver::addFile(StringRef Pat
Optional<MemoryBufferRef> LinkerDriver::readFile(StringRef Path) {
auto MBOrErr = MemoryBuffer::getFile(Path);
- if (std::error_code EC = MBOrErr.getError()) {
- error(MBOrErr, "cannot open " + Path);
+ error(MBOrErr, "cannot open " + Path);
+ if (HasError)
return None;
- }
std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
MemoryBufferRef MBRef = MB->getMemBufferRef();
OwningMBs.push_back(std::move(MB)); // take MB ownership
More information about the llvm-commits
mailing list