[llvm-commits] [lld] r167871 - /lld/trunk/lib/ReaderWriter/ReaderArchive.cpp
Shankar Easwaran
shankare at codeaurora.org
Tue Nov 13 12:34:55 PST 2012
Author: shankare
Date: Tue Nov 13 14:34:55 2012
New Revision: 167871
URL: http://llvm.org/viewvc/llvm-project?rev=167871&view=rev
Log:
changes after mspencer reviews in phabricator
Modified:
lld/trunk/lib/ReaderWriter/ReaderArchive.cpp
Modified: lld/trunk/lib/ReaderWriter/ReaderArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ReaderArchive.cpp?rev=167871&r1=167870&r2=167871&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ReaderArchive.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ReaderArchive.cpp Tue Nov 13 14:34:55 2012
@@ -38,11 +38,7 @@
assert(result.size() == 1);
// give up the pointer so that this object no longer manages it
- for (std::unique_ptr<File> &f : result) {
- return f.release();
- }
-
- return nullptr;
+ return result[0].release();
}
virtual void addAtom(const Atom&) {
@@ -67,8 +63,8 @@
protected:
error_code isDataSymbol(MemoryBuffer *mb, StringRef symbol) const {
- llvm::object::ObjectFile *obj =
- llvm::object::ObjectFile::createObjectFile(mb);
+ std::unique_ptr<llvm::object::ObjectFile>
+ obj(llvm::object::ObjectFile::createObjectFile(mb));
error_code ec;
llvm::object::SymbolRef::Type symtype;
uint32_t symflags;
More information about the llvm-commits
mailing list