summaryrefslogtreecommitdiff
path: root/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-24 13:56:32 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-24 13:56:32 +0000
commit0d50598d71c5cc81c0e777a0ddf3e692e634f565 (patch)
treeb179b244b88112d4c4c3959c85eff70ad202c543 /lib/Object/ObjectFile.cpp
parentd3aaad2d266afb80bb4be2815d45b4300e3f0c0f (diff)
downloadllvm-0d50598d71c5cc81c0e777a0ddf3e692e634f565.tar.gz
llvm-0d50598d71c5cc81c0e777a0ddf3e692e634f565.tar.bz2
llvm-0d50598d71c5cc81c0e777a0ddf3e692e634f565.tar.xz
Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.
Once the objects are constructed, they own the buffer. Passing a unique_ptr makes that clear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/ObjectFile.cpp')
-rw-r--r--lib/Object/ObjectFile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp
index ee2680e6ba..591ed28262 100644
--- a/lib/Object/ObjectFile.cpp
+++ b/lib/Object/ObjectFile.cpp
@@ -23,8 +23,8 @@ using namespace object;
void ObjectFile::anchor() { }
-ObjectFile::ObjectFile(unsigned int Type, MemoryBuffer *Source)
- : SymbolicFile(Type, Source) {}
+ObjectFile::ObjectFile(unsigned int Type, std::unique_ptr<MemoryBuffer> Source)
+ : SymbolicFile(Type, std::move(Source)) {}
std::error_code ObjectFile::printSymbolName(raw_ostream &OS,
DataRefImpl Symb) const {
@@ -77,7 +77,7 @@ ObjectFile::createObjectFile(std::unique_ptr<MemoryBuffer> &Object,
case sys::fs::file_magic::coff_object:
case sys::fs::file_magic::coff_import_library:
case sys::fs::file_magic::pecoff_executable:
- return createCOFFObjectFile(Object.release());
+ return createCOFFObjectFile(std::move(Object));
}
llvm_unreachable("Unexpected Object File Type");
}