summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/lli.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/tools/lli/lli.cpp
parent6bc862dcf55a962b0ee64a583d9ccda5c6687c7c (diff)
downloadbcm5719-llvm-5f2bb7d9b8303c164b5b61f59d2b402926ba8056.tar.gz
bcm5719-llvm-5f2bb7d9b8303c164b5b61f59d2b402926ba8056.zip
Simplify ownership with std::unique_ptr. NFC.
llvm-svn: 215566
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r--llvm/tools/lli/lli.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index fda55e4b575..13c32a75593 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -279,7 +279,7 @@ public:
outfile.close();
}
- MemoryBuffer* getObject(const Module* M) override {
+ std::unique_ptr<MemoryBuffer> getObject(const Module* M) override {
const std::string ModuleID = M->getModuleIdentifier();
std::string CacheName;
if (!getCacheFilename(ModuleID, CacheName))
@@ -294,7 +294,8 @@ public:
// because the file has probably just been mmapped. Instead we make
// a copy. The filed-based buffer will be released when it goes
// out of scope.
- return MemoryBuffer::getMemBufferCopy(IRObjectBuffer.get()->getBuffer());
+ return std::unique_ptr<MemoryBuffer>(
+ MemoryBuffer::getMemBufferCopy(IRObjectBuffer.get()->getBuffer()));
}
private:
OpenPOWER on IntegriCloud