1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Return a std::uinque_ptr. Every caller was already using one.

llvm-svn: 215858
This commit is contained in:
Rafael Espindola 2014-08-17 22:37:39 +00:00
parent 0f0b067a94
commit 4dd4e8c9ed
2 changed files with 6 additions and 5 deletions

View File

@ -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,

View File

@ -165,10 +165,11 @@ LTOModule *LTOModule::makeLTOModule(std::unique_ptr<MemoryBuffer> 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<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.