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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217056
91177308-0d34-0410-b5e6-
96231b3b80d8
return v->isIR();
}
- static ErrorOr<IRObjectFile *> createIRObjectFile(MemoryBufferRef Object,
- LLVMContext &Context);
+ static ErrorOr<std::unique_ptr<IRObjectFile>>
+ createIRObjectFile(MemoryBufferRef Object, LLVMContext &Context);
};
}
}
return basic_symbol_iterator(BasicSymbolRef(Ret, this));
}
-ErrorOr<IRObjectFile *>
+ErrorOr<std::unique_ptr<IRObjectFile>>
llvm::object::IRObjectFile::createIRObjectFile(MemoryBufferRef Object,
LLVMContext &Context) {
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));
}
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:
BufferRef = Buffer->getMemBufferRef();
}
- ErrorOr<object::IRObjectFile *> ObjOrErr =
+ ErrorOr<std::unique_ptr<object::IRObjectFile>> ObjOrErr =
object::IRObjectFile::createIRObjectFile(BufferRef, Context);
std::error_code EC = ObjOrErr.getError();
if (EC == BitcodeError::InvalidBitcodeSignature)
EC.message().c_str());
return LDPS_ERR;
}
- std::unique_ptr<object::IRObjectFile> Obj(ObjOrErr.get());
+ std::unique_ptr<object::IRObjectFile> Obj = std::move(*ObjOrErr);
Modules.resize(Modules.size() + 1);
claimed_file &cf = Modules.back();