unique_ptrify IRObjectFile::createIRObjectFile
I took a guess at the changes to the gold plugin, because that doesn't
seem to build by default for me. Not sure what dependencies I might be
missing for that.
llvm-svn: 217056
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index 0259b46..856f4c6 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -264,7 +264,7 @@
return basic_symbol_iterator(BasicSymbolRef(Ret, this));
}
-ErrorOr<IRObjectFile *>
+ErrorOr<std::unique_ptr<IRObjectFile>>
llvm::object::IRObjectFile::createIRObjectFile(MemoryBufferRef Object,
LLVMContext &Context) {
@@ -275,5 +275,5 @@
return EC;
std::unique_ptr<Module> M(MOrErr.get());
- return new IRObjectFile(Object, std::move(M));
+ return llvm::make_unique<IRObjectFile>(Object, std::move(M));
}
diff --git a/llvm/lib/Object/SymbolicFile.cpp b/llvm/lib/Object/SymbolicFile.cpp
index 17624a3..f8dd4b3 100644
--- a/llvm/lib/Object/SymbolicFile.cpp
+++ b/llvm/lib/Object/SymbolicFile.cpp
@@ -33,8 +33,7 @@
switch (Type) {
case sys::fs::file_magic::bitcode:
if (Context)
- return ErrorOr<std::unique_ptr<SymbolicFile>>(
- IRObjectFile::createIRObjectFile(Object, *Context));
+ return IRObjectFile::createIRObjectFile(Object, *Context);
// Fallthrough
case sys::fs::file_magic::unknown:
case sys::fs::file_magic::archive: