mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Make ObjectFile ownership of the MemoryBuffer optional.
This allows llvm-ar to mmap the input files only once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200040 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -26,12 +26,12 @@ using namespace llvm;
|
||||
using namespace object;
|
||||
|
||||
Binary::~Binary() {
|
||||
delete Data;
|
||||
if (BufferOwned)
|
||||
delete Data;
|
||||
}
|
||||
|
||||
Binary::Binary(unsigned int Type, MemoryBuffer *Source)
|
||||
: TypeID(Type)
|
||||
, Data(Source) {}
|
||||
Binary::Binary(unsigned int Type, MemoryBuffer *Source, bool BufferOwned)
|
||||
: TypeID(Type), BufferOwned(BufferOwned), Data(Source) {}
|
||||
|
||||
StringRef Binary::getData() const {
|
||||
return Data->getBuffer();
|
||||
|
Reference in New Issue
Block a user