Use std::unique_ptr to make the ownership explicit.
[oota-llvm.git] / lib / ExecutionEngine / RuntimeDyld / ObjectImageCommon.h
index c3a21823bbc844422e719da5e35e1edf9b5808ae..51e39e32e7a0de81ab486c5b19021ea2d293bbf0 100644 (file)
@@ -49,7 +49,7 @@ public:
     // FIXME: error checking? createObjectFile returns an ErrorOr<ObjectFile*>
     // and should probably be checked for failure.
     std::unique_ptr<MemoryBuffer> Buf(Buffer->getMemBuffer());
-    ObjFile.reset(object::ObjectFile::createObjectFile(Buf).get());
+    ObjFile = std::move(object::ObjectFile::createObjectFile(Buf).get());
   }
   ObjectImageCommon(std::unique_ptr<object::ObjectFile> Input)
   : ObjectImage(nullptr), ObjFile(std::move(Input))  {}