about summary refs log tree commit diff
path: root/src/rustllvm/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-12-31 14:08:25 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-01-07 21:28:22 +0100
commit30ec68a545ebc128ea8009186249b5b3616c3586 (patch)
tree763ce624d82551c762fec38dee63723019afcab6 /src/rustllvm/ArchiveWrapper.cpp
parent3ec3aa72d4ce2914d04f9dca401f38284be2c2c7 (diff)
downloadrust-30ec68a545ebc128ea8009186249b5b3616c3586.tar.gz
rust-30ec68a545ebc128ea8009186249b5b3616c3586.zip
Handle removal of llvm::make_unique()
Diffstat (limited to 'src/rustllvm/ArchiveWrapper.cpp')
-rw-r--r--src/rustllvm/ArchiveWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rustllvm/ArchiveWrapper.cpp b/src/rustllvm/ArchiveWrapper.cpp
index dd0111d3f2c..678d787571e 100644
--- a/src/rustllvm/ArchiveWrapper.cpp
+++ b/src/rustllvm/ArchiveWrapper.cpp
@@ -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());