[llvm] r217052 - unique_ptrify MachOUniversalBinary::create
David Blaikie
dblaikie at gmail.com
Wed Sep 3 10:41:05 PDT 2014
Author: dblaikie
Date: Wed Sep 3 12:41:05 2014
New Revision: 217052
URL: http://llvm.org/viewvc/llvm-project?rev=217052&view=rev
Log:
unique_ptrify MachOUniversalBinary::create
Modified:
llvm/trunk/include/llvm/Object/MachOUniversal.h
llvm/trunk/lib/Object/Binary.cpp
llvm/trunk/lib/Object/MachOUniversal.cpp
Modified: llvm/trunk/include/llvm/Object/MachOUniversal.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/MachOUniversal.h?rev=217052&r1=217051&r2=217052&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/MachOUniversal.h (original)
+++ llvm/trunk/include/llvm/Object/MachOUniversal.h Wed Sep 3 12:41:05 2014
@@ -85,7 +85,8 @@ public:
};
MachOUniversalBinary(MemoryBufferRef Souce, std::error_code &EC);
- static ErrorOr<MachOUniversalBinary *> create(MemoryBufferRef Source);
+ static ErrorOr<std::unique_ptr<MachOUniversalBinary>>
+ create(MemoryBufferRef Source);
object_iterator begin_objects() const {
return ObjectForArch(this, 0);
Modified: llvm/trunk/lib/Object/Binary.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Binary.cpp?rev=217052&r1=217051&r2=217052&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Binary.cpp (original)
+++ llvm/trunk/lib/Object/Binary.cpp Wed Sep 3 12:41:05 2014
@@ -63,8 +63,7 @@ ErrorOr<std::unique_ptr<Binary>> object:
case sys::fs::file_magic::bitcode:
return ObjectFile::createSymbolicFile(Buffer, Type, Context);
case sys::fs::file_magic::macho_universal_binary:
- return ErrorOr<std::unique_ptr<Binary>>(
- MachOUniversalBinary::create(Buffer));
+ return MachOUniversalBinary::create(Buffer);
case sys::fs::file_magic::unknown:
case sys::fs::file_magic::windows_resource:
// Unrecognized object file format.
Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=217052&r1=217051&r2=217052&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
+++ llvm/trunk/lib/Object/MachOUniversal.cpp Wed Sep 3 12:41:05 2014
@@ -97,14 +97,14 @@ std::error_code MachOUniversalBinary::Ob
void MachOUniversalBinary::anchor() { }
-ErrorOr<MachOUniversalBinary *>
+ErrorOr<std::unique_ptr<MachOUniversalBinary>>
MachOUniversalBinary::create(MemoryBufferRef Source) {
std::error_code EC;
std::unique_ptr<MachOUniversalBinary> Ret(
new MachOUniversalBinary(Source, EC));
if (EC)
return EC;
- return Ret.release();
+ return std::move(Ret);
}
MachOUniversalBinary::MachOUniversalBinary(MemoryBufferRef Source,
More information about the llvm-commits
mailing list