unique_ptrify a bunch of stuff through RuntimeDyld::loadObject
[oota-llvm.git] / lib / ExecutionEngine / RuntimeDyld / ObjectImageCommon.h
index ddf0e89b40830e5a825dccbaa8b60cc5c0ad1acc..9bbf6a0d809e431649db9983e52f3b7773774b6d 100644 (file)
@@ -36,16 +36,13 @@ protected:
 
   // This form of the constructor allows subclasses to use
   // format-specific subclasses of ObjectFile directly
-  ObjectImageCommon(ObjectBuffer *Input, std::unique_ptr<object::ObjectFile> Obj)
-  : ObjectImage(Input), // saves Input as Buffer and takes ownership
-    ObjFile(std::move(Obj))
-  {
-  }
+  ObjectImageCommon(std::unique_ptr<ObjectBuffer> Input,
+                    std::unique_ptr<object::ObjectFile> Obj)
+      : ObjectImage(std::move(Input)), ObjFile(std::move(Obj)) {}
 
 public:
-  ObjectImageCommon(ObjectBuffer* Input)
-  : ObjectImage(Input) // saves Input as Buffer and takes ownership
-  {
+  ObjectImageCommon(std::unique_ptr<ObjectBuffer> Input)
+      : ObjectImage(std::move(Input)) {
     // FIXME: error checking? createObjectFile returns an ErrorOr<ObjectFile*>
     // and should probably be checked for failure.
     MemoryBufferRef Buf = Buffer->getMemBuffer();