Make ObjectFile and BitcodeReader always own the MemoryBuffer.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 23 Jun 2014 21:53:12 +0000 (21:53 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 23 Jun 2014 21:53:12 +0000 (21:53 +0000)
commit1f659329b63aa1d1af2b2bfc8b174a8ccdaba2c0
treedc64a751796af7cd61a83b0cb8a8d8ca3145a95c
parent7e7e89f17819d30703543375120dff52d5aaa414
Make ObjectFile and BitcodeReader always own the MemoryBuffer.

This allows us to just use a std::unique_ptr to store the pointer to the buffer.
The flip side is that they have to support releasing the buffer back to the
caller.

Overall this looks like a more efficient and less brittle api.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211542 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
include/llvm/Bitcode/ReaderWriter.h
include/llvm/IR/GVMaterializer.h
include/llvm/IR/Module.h
include/llvm/Object/Binary.h
include/llvm/Object/COFF.h
include/llvm/Object/ELFObjectFile.h
include/llvm/Object/IRObjectFile.h
include/llvm/Object/MachO.h
include/llvm/Object/ObjectFile.h
include/llvm/Object/SymbolicFile.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Reader/BitcodeReader.h
lib/IR/Module.cpp
lib/Object/Archive.cpp
lib/Object/Binary.cpp
lib/Object/COFFObjectFile.cpp
lib/Object/ELFObjectFile.cpp
lib/Object/IRObjectFile.cpp
lib/Object/MachOObjectFile.cpp
lib/Object/ObjectFile.cpp
lib/Object/SymbolicFile.cpp
tools/llvm-ar/llvm-ar.cpp
tools/llvm-nm/llvm-nm.cpp