summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit2e60ca964ccb6a8531559238b28658e1aa4b0d75 (patch)
tree5842ce349e814931985e4734f521de90e0b90913 /llvm/lib/Object/ObjectFile.cpp
parente8b1f91afb850bdfcd4770caeb6ff9897c33ccbe (diff)
downloadbcm5719-llvm-2e60ca964ccb6a8531559238b28658e1aa4b0d75.tar.gz
bcm5719-llvm-2e60ca964ccb6a8531559238b28658e1aa4b0d75.zip
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. llvm-svn: 211595
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index ee2680e6ba0..591ed28262e 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/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");
}
OpenPOWER on IntegriCloud