summaryrefslogtreecommitdiff
path: root/unittests/ExecutionEngine
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-27 20:03:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-27 20:03:13 +0000
commit1a7f705fba4b387ad251b0f303acec5c7131971d (patch)
tree632d01e6e0e3fae312f0ce106697c721529ae219 /unittests/ExecutionEngine
parentb2f71836eb550319748c96c331c7ffe791f3a9c3 (diff)
Return a std::unique_ptr when creating a new MemoryBuffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ExecutionEngine')
-rw-r--r--unittests/ExecutionEngine/JIT/JITTest.cpp6
-rw-r--r--unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp7
2 files changed, 6 insertions, 7 deletions
diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp
index 55b86125776..ffedbfc1239 100644
--- a/unittests/ExecutionEngine/JIT/JITTest.cpp
+++ b/unittests/ExecutionEngine/JIT/JITTest.cpp
@@ -632,9 +632,9 @@ std::string AssembleToBitcode(LLVMContext &Context, const char *Assembly) {
ExecutionEngine *getJITFromBitcode(
LLVMContext &Context, const std::string &Bitcode, Module *&M) {
// c_str() is null-terminated like MemoryBuffer::getMemBuffer requires.
- std::unique_ptr<MemoryBuffer> BitcodeBuffer(
- MemoryBuffer::getMemBuffer(Bitcode, "Bitcode for test"));
- ErrorOr<Module*> ModuleOrErr = getLazyBitcodeModule(BitcodeBuffer, Context);
+ std::unique_ptr<MemoryBuffer> BitcodeBuffer =
+ MemoryBuffer::getMemBuffer(Bitcode, "Bitcode for test");
+ ErrorOr<Module *> ModuleOrErr = getLazyBitcodeModule(BitcodeBuffer, Context);
if (std::error_code EC = ModuleOrErr.getError()) {
ADD_FAILURE() << EC.message();
return nullptr;
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
index f230fb82434..8756a2b1782 100644
--- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
+++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
@@ -41,8 +41,7 @@ public:
return nullptr;
// Our test cache wants to maintain ownership of its object buffers
// so we make a copy here for the execution engine.
- return std::unique_ptr<MemoryBuffer>(
- MemoryBuffer::getMemBufferCopy(BufferFound->getBuffer()));
+ return MemoryBuffer::getMemBufferCopy(BufferFound->getBuffer());
}
// Test-harness-specific functions
@@ -65,8 +64,8 @@ public:
private:
MemoryBuffer *copyBuffer(MemoryBufferRef Buf) {
// Create a local copy of the buffer.
- std::unique_ptr<MemoryBuffer> NewBuffer(
- MemoryBuffer::getMemBufferCopy(Buf.getBuffer()));
+ std::unique_ptr<MemoryBuffer> NewBuffer =
+ MemoryBuffer::getMemBufferCopy(Buf.getBuffer());
MemoryBuffer *Ret = NewBuffer.get();
AllocatedBuffers.push_back(std::move(NewBuffer));
return Ret;