aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-13 18:49:01 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-13 18:49:01 +0000
commit5f2bb7d9b8303c164b5b61f59d2b402926ba8056 (patch)
tree7b767a19b645fc420a16d8c281f988eb12c06539 /llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
parent6bc862dcf55a962b0ee64a583d9ccda5c6687c7c (diff)
downloadllvm-5f2bb7d9b8303c164b5b61f59d2b402926ba8056.zip
llvm-5f2bb7d9b8303c164b5b61f59d2b402926ba8056.tar.gz
llvm-5f2bb7d9b8303c164b5b61f59d2b402926ba8056.tar.bz2
Simplify ownership with std::unique_ptr. NFC.
llvm-svn: 215566
Diffstat (limited to 'llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
index fbbab42..5732908c 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
@@ -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