mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
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
This commit is contained in:
@ -177,8 +177,7 @@ protected:
|
||||
bool isDyldELFObject;
|
||||
|
||||
public:
|
||||
ELFObjectFile(MemoryBuffer *Object, std::error_code &EC,
|
||||
bool BufferOwned = true);
|
||||
ELFObjectFile(MemoryBuffer *Object, std::error_code &EC);
|
||||
|
||||
const Elf_Sym *getSymbol(DataRefImpl Symb) const;
|
||||
|
||||
@ -774,12 +773,11 @@ ELFObjectFile<ELFT>::getRela(DataRefImpl Rela) const {
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
ELFObjectFile<ELFT>::ELFObjectFile(MemoryBuffer *Object, std::error_code &ec,
|
||||
bool BufferOwned)
|
||||
ELFObjectFile<ELFT>::ELFObjectFile(MemoryBuffer *Object, std::error_code &ec)
|
||||
: ObjectFile(getELFType(static_cast<endianness>(ELFT::TargetEndianness) ==
|
||||
support::little,
|
||||
ELFT::Is64Bits),
|
||||
Object, BufferOwned),
|
||||
Object),
|
||||
EF(Object, ec) {}
|
||||
|
||||
template <class ELFT>
|
||||
|
Reference in New Issue
Block a user