From 2b861c3a24fa299d6b8a2d5097114c1000354bee Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 17 Aug 2014 22:37:39 +0000 Subject: [PATCH] Return a std::uinque_ptr. Every caller was already using one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215858 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/LTO/LTOModule.h | 4 ++-- lib/LTO/LTOModule.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/llvm/LTO/LTOModule.h b/include/llvm/LTO/LTOModule.h index 4dac797ca86..80cbac86ed3 100644 --- a/include/llvm/LTO/LTOModule.h +++ b/include/llvm/LTO/LTOModule.h @@ -71,8 +71,8 @@ public: StringRef triplePrefix); /// Create a MemoryBuffer from a memory range with an optional name. - static MemoryBuffer *makeBuffer(const void *mem, size_t length, - StringRef name = ""); + static std::unique_ptr + makeBuffer(const void *mem, size_t length, StringRef name = ""); /// Create an LTOModule. N.B. These methods take ownership of the buffer. The /// caller must have initialized the Targets, the TargetMCs, the AsmPrinters, diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index c4b9357e0f0..5083a59900a 100644 --- a/lib/LTO/LTOModule.cpp +++ b/lib/LTO/LTOModule.cpp @@ -165,10 +165,11 @@ LTOModule *LTOModule::makeLTOModule(std::unique_ptr Buffer, } /// Create a MemoryBuffer from a memory range with an optional name. -MemoryBuffer *LTOModule::makeBuffer(const void *mem, size_t length, - StringRef name) { +std::unique_ptr +LTOModule::makeBuffer(const void *mem, size_t length, StringRef name) { const char *startPtr = (const char*)mem; - return MemoryBuffer::getMemBuffer(StringRef(startPtr, length), name, false); + return std::unique_ptr( + MemoryBuffer::getMemBuffer(StringRef(startPtr, length), name, false)); } /// objcClassNameFromExpression - Get string that the data pointer points to. -- 2.34.1