about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.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/RustWrapper.cpp
parent3ec3aa72d4ce2914d04f9dca401f38284be2c2c7 (diff)
downloadrust-30ec68a545ebc128ea8009186249b5b3616c3586.tar.gz
rust-30ec68a545ebc128ea8009186249b5b3616c3586.zip
Handle removal of llvm::make_unique()
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 720928e48e3..224197a905e 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -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);
     {