[llvm] r215858 - Return a std::uinque_ptr. Every caller was already using one.

Rafael Espindola rafael.espindola at gmail.com
Sun Aug 17 15:37:39 PDT 2014


Author: rafael
Date: Sun Aug 17 17:37:39 2014
New Revision: 215858

URL: http://llvm.org/viewvc/llvm-project?rev=215858&view=rev
Log:
Return a std::uinque_ptr. Every caller was already using one.

Modified:
    llvm/trunk/include/llvm/LTO/LTOModule.h
    llvm/trunk/lib/LTO/LTOModule.cpp

Modified: llvm/trunk/include/llvm/LTO/LTOModule.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTOModule.h?rev=215858&r1=215857&r2=215858&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTOModule.h (original)
+++ llvm/trunk/include/llvm/LTO/LTOModule.h Sun Aug 17 17:37:39 2014
@@ -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<MemoryBuffer>
+  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,

Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=215858&r1=215857&r2=215858&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Sun Aug 17 17:37:39 2014
@@ -165,10 +165,11 @@ LTOModule *LTOModule::makeLTOModule(std:
 }
 
 /// 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<MemoryBuffer>
+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>(
+      MemoryBuffer::getMemBuffer(StringRef(startPtr, length), name, false));
 }
 
 /// objcClassNameFromExpression - Get string that the data pointer points to.





More information about the llvm-commits mailing list