mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
Simplify ownership with std::unique_ptr. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215566 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,14 +44,15 @@ public:
|
||||
ObjMap[ModuleID] = copyBuffer(Obj);
|
||||
}
|
||||
|
||||
virtual MemoryBuffer* getObject(const Module* M) {
|
||||
virtual std::unique_ptr<MemoryBuffer> getObject(const Module* M) {
|
||||
const MemoryBuffer* BufferFound = getObjectInternal(M);
|
||||
ModulesLookedUp.insert(M->getModuleIdentifier());
|
||||
if (!BufferFound)
|
||||
return nullptr;
|
||||
// Our test cache wants to maintain ownership of its object buffers
|
||||
// so we make a copy here for the execution engine.
|
||||
return MemoryBuffer::getMemBufferCopy(BufferFound->getBuffer());
|
||||
return std::unique_ptr<MemoryBuffer>(
|
||||
MemoryBuffer::getMemBufferCopy(BufferFound->getBuffer()));
|
||||
}
|
||||
|
||||
// Test-harness-specific functions
|
||||
|
Reference in New Issue
Block a user