mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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
This commit is contained in:
@ -208,7 +208,7 @@ class ObjectFile : public SymbolicFile {
|
||||
ObjectFile(const ObjectFile &other) LLVM_DELETED_FUNCTION;
|
||||
|
||||
protected:
|
||||
ObjectFile(unsigned int Type, MemoryBuffer *Source);
|
||||
ObjectFile(unsigned int Type, std::unique_ptr<MemoryBuffer> Source);
|
||||
|
||||
const uint8_t *base() const {
|
||||
return reinterpret_cast<const uint8_t *>(Data->getBufferStart());
|
||||
@ -347,7 +347,8 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
static ErrorOr<ObjectFile *> createCOFFObjectFile(MemoryBuffer *Object);
|
||||
static ErrorOr<ObjectFile *>
|
||||
createCOFFObjectFile(std::unique_ptr<MemoryBuffer> Object);
|
||||
static ErrorOr<ObjectFile *>
|
||||
createELFObjectFile(std::unique_ptr<MemoryBuffer> &Object);
|
||||
static ErrorOr<ObjectFile *>
|
||||
|
Reference in New Issue
Block a user