1
Fork 0

Handle removal of llvm::make_unique()

This commit is contained in:
Nikita Popov 2019-12-31 14:08:25 +01:00
parent 3ec3aa72d4
commit 30ec68a545
4 changed files with 17 additions and 2 deletions

View file

@ -89,7 +89,11 @@ extern "C" void LLVMRustDestroyArchive(LLVMRustArchiveRef RustArchive) {
extern "C" LLVMRustArchiveIteratorRef
LLVMRustArchiveIteratorNew(LLVMRustArchiveRef RustArchive) {
Archive *Archive = RustArchive->getBinary();
#if LLVM_VERSION_GE(10, 0)
std::unique_ptr<Error> Err = std::make_unique<Error>(Error::success());
#else
std::unique_ptr<Error> Err = llvm::make_unique<Error>(Error::success());
#endif
auto Cur = Archive->child_begin(*Err);
if (*Err) {
LLVMRustSetLastError(toString(std::move(*Err)).c_str());

View file

@ -18,8 +18,7 @@ extern "C" RustLinker*
LLVMRustLinkerNew(LLVMModuleRef DstRef) {
Module *Dst = unwrap(DstRef);
auto Ret = llvm::make_unique<RustLinker>(*Dst);
return Ret.release();
return new RustLinker(*Dst);
}
extern "C" void

View file

@ -863,7 +863,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
int num_modules,
const char **preserved_symbols,
int num_symbols) {
#if LLVM_VERSION_GE(10, 0)
auto Ret = std::make_unique<LLVMRustThinLTOData>();
#else
auto Ret = llvm::make_unique<LLVMRustThinLTOData>();
#endif
// Load each module's summary and merge it into one combined index
for (int i = 0; i < num_modules; i++) {
@ -1095,7 +1099,11 @@ struct LLVMRustThinLTOBuffer {
extern "C" LLVMRustThinLTOBuffer*
LLVMRustThinLTOBufferCreate(LLVMModuleRef M) {
#if LLVM_VERSION_GE(10, 0)
auto Ret = std::make_unique<LLVMRustThinLTOBuffer>();
#else
auto Ret = llvm::make_unique<LLVMRustThinLTOBuffer>();
#endif
{
raw_string_ostream OS(Ret->data);
{

View file

@ -1450,7 +1450,11 @@ struct LLVMRustModuleBuffer {
extern "C" LLVMRustModuleBuffer*
LLVMRustModuleBufferCreate(LLVMModuleRef M) {
#if LLVM_VERSION_GE(10, 0)
auto Ret = std::make_unique<LLVMRustModuleBuffer>();
#else
auto Ret = llvm::make_unique<LLVMRustModuleBuffer>();
#endif
{
raw_string_ostream OS(Ret->data);
{