mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
unique_ptrify a bunch of stuff through RuntimeDyld::loadObject
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -29,7 +29,7 @@ class ObjectBuffer {
|
||||
virtual void anchor();
|
||||
public:
|
||||
ObjectBuffer() {}
|
||||
ObjectBuffer(MemoryBuffer* Buf) : Buffer(Buf) {}
|
||||
ObjectBuffer(std::unique_ptr<MemoryBuffer> Buf) : Buffer(std::move(Buf)) {}
|
||||
virtual ~ObjectBuffer() {}
|
||||
|
||||
MemoryBufferRef getMemBuffer() const { return Buffer->getMemBufferRef(); }
|
||||
|
@@ -31,7 +31,7 @@ protected:
|
||||
std::unique_ptr<ObjectBuffer> Buffer;
|
||||
|
||||
public:
|
||||
ObjectImage(ObjectBuffer *Input) : Buffer(Input) {}
|
||||
ObjectImage(std::unique_ptr<ObjectBuffer> Input) : Buffer(std::move(Input)) {}
|
||||
virtual ~ObjectImage() {}
|
||||
|
||||
virtual object::symbol_iterator begin_symbols() const = 0;
|
||||
|
@@ -53,13 +53,15 @@ public:
|
||||
/// Ownership of the input buffer is transferred to the ObjectImage
|
||||
/// instance returned from this function if successful. In the case of load
|
||||
/// failure, the input buffer will be deleted.
|
||||
ObjectImage *loadObject(ObjectBuffer *InputBuffer);
|
||||
std::unique_ptr<ObjectImage>
|
||||
loadObject(std::unique_ptr<ObjectBuffer> InputBuffer);
|
||||
|
||||
/// Prepare the referenced object file for execution.
|
||||
/// Ownership of the input object is transferred to the ObjectImage
|
||||
/// instance returned from this function if successful. In the case of load
|
||||
/// failure, the input object will be deleted.
|
||||
ObjectImage *loadObject(std::unique_ptr<object::ObjectFile> InputObject);
|
||||
std::unique_ptr<ObjectImage>
|
||||
loadObject(std::unique_ptr<object::ObjectFile> InputObject);
|
||||
|
||||
/// Get the address of our local copy of the symbol. This may or may not
|
||||
/// be the address used for relocation (clients can copy the data around
|
||||
|
Reference in New Issue
Block a user