[lld] r211596 - Update for llvm api change.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jun 24 06:57:13 PDT 2014
Author: rafael
Date: Tue Jun 24 08:57:13 2014
New Revision: 211596
URL: http://llvm.org/viewvc/llvm-project?rev=211596&view=rev
Log:
Update for llvm api change.
Modified:
lld/trunk/lib/ReaderWriter/FileArchive.cpp
Modified: lld/trunk/lib/ReaderWriter/FileArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/FileArchive.cpp?rev=211596&r1=211595&r2=211596&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/FileArchive.cpp (original)
+++ lld/trunk/lib/ReaderWriter/FileArchive.cpp Tue Jun 24 08:57:13 2014
@@ -215,12 +215,13 @@ public:
std::error_code
parseFile(std::unique_ptr<MemoryBuffer> &mb, const Registry ®,
std::vector<std::unique_ptr<File>> &result) const override {
+ MemoryBuffer &buff = *mb;
// Make Archive object which will be owned by FileArchive object.
std::error_code ec;
- Archive *archive = new Archive(mb.get(), ec);
+ Archive *archive = new Archive(std::move(mb), ec);
if (ec)
return ec;
- StringRef path = mb->getBufferIdentifier();
+ StringRef path = buff.getBufferIdentifier();
// Construct FileArchive object.
std::unique_ptr<FileArchive> file(
new FileArchive(reg, archive, path, false, _logLoading));
@@ -228,9 +229,6 @@ public:
if (ec)
return ec;
- // Transfer ownership of memory buffer to Archive object.
- mb.release();
-
result.push_back(std::move(file));
return std::error_code();
}
More information about the llvm-commits
mailing list