mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-13 17:38:39 +00:00
Use copy initialization to initialize std::unique_ptr.
Thanks to David Blaikie for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215867 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4570cfa5e4
commit
6de46b5183
@ -157,7 +157,7 @@ ObjectBufferStream* MCJIT::emitObject(Module *M) {
|
|||||||
if (ObjCache) {
|
if (ObjCache) {
|
||||||
// MemoryBuffer is a thin wrapper around the actual memory, so it's OK
|
// MemoryBuffer is a thin wrapper around the actual memory, so it's OK
|
||||||
// to create a temporary object here and delete it after the call.
|
// to create a temporary object here and delete it after the call.
|
||||||
std::unique_ptr<MemoryBuffer> MB(CompiledObject->getMemBuffer());
|
std::unique_ptr<MemoryBuffer> MB = CompiledObject->getMemBuffer();
|
||||||
ObjCache->notifyObjectCompiled(M, MB.get());
|
ObjCache->notifyObjectCompiled(M, MB.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public:
|
|||||||
{
|
{
|
||||||
// FIXME: error checking? createObjectFile returns an ErrorOr<ObjectFile*>
|
// FIXME: error checking? createObjectFile returns an ErrorOr<ObjectFile*>
|
||||||
// and should probably be checked for failure.
|
// and should probably be checked for failure.
|
||||||
std::unique_ptr<MemoryBuffer> Buf(Buffer->getMemBuffer());
|
std::unique_ptr<MemoryBuffer> Buf = Buffer->getMemBuffer();
|
||||||
ObjFile = std::move(object::ObjectFile::createObjectFile(Buf).get());
|
ObjFile = std::move(object::ObjectFile::createObjectFile(Buf).get());
|
||||||
}
|
}
|
||||||
ObjectImageCommon(std::unique_ptr<object::ObjectFile> Input)
|
ObjectImageCommon(std::unique_ptr<object::ObjectFile> Input)
|
||||||
|
@ -222,7 +222,7 @@ ObjectImage *RuntimeDyldELF::createObjectImage(ObjectBuffer *Buffer) {
|
|||||||
(uint8_t)Buffer->getBufferStart()[ELF::EI_DATA]);
|
(uint8_t)Buffer->getBufferStart()[ELF::EI_DATA]);
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
|
|
||||||
std::unique_ptr<MemoryBuffer> Buf(Buffer->getMemBuffer());
|
std::unique_ptr<MemoryBuffer> Buf = Buffer->getMemBuffer();
|
||||||
|
|
||||||
if (Ident.first == ELF::ELFCLASS32 && Ident.second == ELF::ELFDATA2LSB) {
|
if (Ident.first == ELF::ELFCLASS32 && Ident.second == ELF::ELFDATA2LSB) {
|
||||||
auto Obj =
|
auto Obj =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user