Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (1ba31e53eee270b8103455a523c5869c21197a19)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (1ba31e53eee270b8103455a523c5869c21197a19)
  • Date: Thu, 28 Sep 2017 21:08:18 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

devel/rust/HISTORY
| 4
devel/rust/PRE_BUILD
| 1

devel/rust/patches/0001-Relax-a-codegen-test-to-be-compatible-with-LLVM-5.0.patch
| 59 +
devel/rust/patches/0002-Fix-archive-member-names-on-5.0.patch
| 34 +
devel/rust/patches/0003-update-attributes-API-usage.patch
| 98 ++

devel/rust/patches/0004-rustllvm-split-DebugLoc-in-UnpackOptimizationDiagnos.patch
| 195 +++++
devel/rust/patches/0005-rustllvm-update-to-SyncScope-ID.patch
| 43 +
devel/rust/patches/0006-rustllvm-adjust-usage-of-createNameSpace.patch
| 29
devel/rust/patches/0007-rustllvm-adjust-usage-of-createPointerType.patch
| 40 +
devel/rust/patches/0008-rustllvm-use-LLVMMetadataRef.patch
| 338 ++++++++++
devel/rust/patches/0009-rustllvm-define-LLVM_VERSION_LT.patch
| 25
11 files changed, 866 insertions(+)

New commits:
commit 1ba31e53eee270b8103455a523c5869c21197a19
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

devel/rust: added upstream fixes for building with llvm 5.0

diff --git a/devel/rust/HISTORY b/devel/rust/HISTORY
index c537776..7c08bf4 100644
--- a/devel/rust/HISTORY
+++ b/devel/rust/HISTORY
@@ -1,3 +1,7 @@
+2017-09-28 Pavel Vinogradov <public AT sourcemage.org>
+ * PRE_BUILD, patches/000[1-9]*.patch: added slightly modified upstream
+ patches to build with llvm 5.0
+
2017-09-01 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 1.20.0
* BUILD: added fixes for not bootstrapping docs & using pre-installed
diff --git a/devel/rust/PRE_BUILD b/devel/rust/PRE_BUILD
index 8204fb0..3fae5d7 100755
--- a/devel/rust/PRE_BUILD
+++ b/devel/rust/PRE_BUILD
@@ -1,4 +1,5 @@
default_pre_build &&
cd $SOURCE_DIRECTORY &&
+apply_patch_dir patches &&
# avoid rebuilding llvm
rm -r src/llvm
diff --git
a/devel/rust/patches/0001-Relax-a-codegen-test-to-be-compatible-with-LLVM-5.0.patch

b/devel/rust/patches/0001-Relax-a-codegen-test-to-be-compatible-with-LLVM-5.0.patch
new file mode 100644
index 0000000..1fc38b7
--- /dev/null
+++
b/devel/rust/patches/0001-Relax-a-codegen-test-to-be-compatible-with-LLVM-5.0.patch
@@ -0,0 +1,59 @@
+From 38e40ce50653b8164915b8142e883c5a57b33e7b Mon Sep 17 00:00:00 2001
+From: Alex Crichton <alex AT alexcrichton.com>
+Date: Fri, 21 Jul 2017 14:13:47 -0700
+Subject: [PATCH] Relax a codegen test to be compatible with LLVM 5.0
+
+---
+ src/test/codegen/lifetime_start_end.rs | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/test/codegen/lifetime_start_end.rs
b/src/test/codegen/lifetime_start_end.rs
+index 5c1f1f8f2b..1f900a3770 100644
+--- a/src/test/codegen/lifetime_start_end.rs
++++ b/src/test/codegen/lifetime_start_end.rs
+@@ -19,34 +19,34 @@ pub fn test() {
+ &a; // keep variable in an alloca
+
+ // CHECK: [[S_a:%[0-9]+]] = bitcast i32* %a to i8*
+-// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_a]])
++// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S_a]])
+
+ {
+ let b = &Some(a);
+ &b; // keep variable in an alloca
+
+ // CHECK: [[S_b:%[0-9]+]] = bitcast %"core::option::Option<i32>"** %b to i8*
+-// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_b]])
++// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S_b]])
+
+ // CHECK: [[S__5:%[0-9]+]] = bitcast %"core::option::Option<i32>"* %_5 to
i8*
+-// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S__5]])
++// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S__5]])
+
+ // CHECK: [[E_b:%[0-9]+]] = bitcast %"core::option::Option<i32>"** %b to i8*
+-// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_b]])
++// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E_b]])
+
+ // CHECK: [[E__5:%[0-9]+]] = bitcast %"core::option::Option<i32>"* %_5 to
i8*
+-// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E__5]])
++// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E__5]])
+ }
+
+ let c = 1;
+ &c; // keep variable in an alloca
+
+ // CHECK: [[S_c:%[0-9]+]] = bitcast i32* %c to i8*
+-// CHECK: call void @llvm.lifetime.start(i{{[0-9 ]+}}, i8* [[S_c]])
++// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, i8* [[S_c]])
+
+ // CHECK: [[E_c:%[0-9]+]] = bitcast i32* %c to i8*
+-// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_c]])
++// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E_c]])
+
+ // CHECK: [[E_a:%[0-9]+]] = bitcast i32* %a to i8*
+-// CHECK: call void @llvm.lifetime.end(i{{[0-9 ]+}}, i8* [[E_a]])
++// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, i8* [[E_a]])
+ }
+--
+2.14.2
+
diff --git a/devel/rust/patches/0002-Fix-archive-member-names-on-5.0.patch
b/devel/rust/patches/0002-Fix-archive-member-names-on-5.0.patch
new file mode 100644
index 0000000..09d79b0
--- /dev/null
+++ b/devel/rust/patches/0002-Fix-archive-member-names-on-5.0.patch
@@ -0,0 +1,34 @@
+From fb217afe86a5b9fccf8565d2d15afc83fceb91b6 Mon Sep 17 00:00:00 2001
+From: Alex Crichton <alex AT alexcrichton.com>
+Date: Fri, 21 Jul 2017 09:41:29 -0700
+Subject: [PATCH] Fix archive member names on 5.0
+
+---
+ src/rustllvm/ArchiveWrapper.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/rustllvm/ArchiveWrapper.cpp
b/src/rustllvm/ArchiveWrapper.cpp
+index f04251136f..7f76861c07 100644
+--- a/src/rustllvm/ArchiveWrapper.cpp
++++ b/src/rustllvm/ArchiveWrapper.cpp
+@@ -12,6 +12,7 @@
+
+ #include "llvm/Object/Archive.h"
+ #include "llvm/Object/ArchiveWriter.h"
++#include "llvm/Support/Path.h"
+
+ using namespace llvm;
+ using namespace llvm::object;
+@@ -256,6 +257,9 @@ LLVMRustWriteArchive(char *Dst, size_t NumMembers,
+ LLVMRustSetLastError(toString(MOrErr.takeError()).c_str());
+ return LLVMRustResult::Failure;
+ }
++#if LLVM_VERSION_GE(5, 0)
++ MOrErr->MemberName = sys::path::filename(MOrErr->MemberName);
++#endif
+ Members.push_back(std::move(*MOrErr));
+ #elif LLVM_VERSION_EQ(3, 8)
+ Members.push_back(NewArchiveIterator(Member->Filename));
+--
+2.14.2
+
diff --git a/devel/rust/patches/0003-update-attributes-API-usage.patch
b/devel/rust/patches/0003-update-attributes-API-usage.patch
new file mode 100644
index 0000000..4a30199
--- /dev/null
+++ b/devel/rust/patches/0003-update-attributes-API-usage.patch
@@ -0,0 +1,98 @@
+From b022d54641586ae1de72cd6325eb09aee7753cca Mon Sep 17 00:00:00 2001
+From: Alex Crichton <alex AT alexcrichton.com>
+Date: Fri, 21 Jul 2017 18:15:03 +0200
+Subject: [PATCH] update attributes API usage
+
+---
+ src/rustllvm/RustWrapper.cpp | 27 ++++++++++++++++++++++++++-
+ 1 file changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index 94185b5432..15a04ba00e 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -167,10 +167,14 @@ extern "C" void
LLVMRustAddCallSiteAttribute(LLVMValueRef Instr, unsigned Index,
+ LLVMRustAttribute RustAttr) {
+ CallSite Call = CallSite(unwrap<Instruction>(Instr));
+ Attribute Attr = Attribute::get(Call->getContext(), fromRust(RustAttr));
++#if LLVM_VERSION_GE(5, 0)
++ Call.addAttribute(Index, Attr);
++#else
+ AttrBuilder B(Attr);
+ Call.setAttributes(Call.getAttributes().addAttributes(
+ Call->getContext(), Index,
+ AttributeSet::get(Call->getContext(), Index, B)));
++#endif
+ }
+
+ extern "C" void LLVMRustAddDereferenceableCallSiteAttr(LLVMValueRef Instr,
+@@ -179,9 +183,14 @@ extern "C" void
LLVMRustAddDereferenceableCallSiteAttr(LLVMValueRef Instr,
+ CallSite Call = CallSite(unwrap<Instruction>(Instr));
+ AttrBuilder B;
+ B.addDereferenceableAttr(Bytes);
++#if LLVM_VERSION_GE(5, 0)
++ Call.setAttributes(Call.getAttributes().addAttributes(
++ Call->getContext(), Index, B));
++#else
+ Call.setAttributes(Call.getAttributes().addAttributes(
+ Call->getContext(), Index,
+ AttributeSet::get(Call->getContext(), Index, B)));
++#endif
+ }
+
+ extern "C" void LLVMRustAddFunctionAttribute(LLVMValueRef Fn, unsigned
Index,
+@@ -189,7 +198,11 @@ extern "C" void
LLVMRustAddFunctionAttribute(LLVMValueRef Fn, unsigned Index,
+ Function *A = unwrap<Function>(Fn);
+ Attribute Attr = Attribute::get(A->getContext(), fromRust(RustAttr));
+ AttrBuilder B(Attr);
++#if LLVM_VERSION_GE(5, 0)
++ A->addAttributes(Index, B);
++#else
+ A->addAttributes(Index, AttributeSet::get(A->getContext(), Index, B));
++#endif
+ }
+
+ extern "C" void LLVMRustAddDereferenceableAttr(LLVMValueRef Fn, unsigned
Index,
+@@ -197,7 +210,11 @@ extern "C" void
LLVMRustAddDereferenceableAttr(LLVMValueRef Fn, unsigned Index,
+ Function *A = unwrap<Function>(Fn);
+ AttrBuilder B;
+ B.addDereferenceableAttr(Bytes);
++#if LLVM_VERSION_GE(5, 0)
++ A->addAttributes(Index, B);
++#else
+ A->addAttributes(Index, AttributeSet::get(A->getContext(), Index, B));
++#endif
+ }
+
+ extern "C" void LLVMRustAddFunctionAttrStringValue(LLVMValueRef Fn,
+@@ -207,18 +224,26 @@ extern "C" void
LLVMRustAddFunctionAttrStringValue(LLVMValueRef Fn,
+ Function *F = unwrap<Function>(Fn);
+ AttrBuilder B;
+ B.addAttribute(Name, Value);
++#if LLVM_VERSION_GE(5, 0)
++ F->addAttributes(Index, B);
++#else
+ F->addAttributes(Index, AttributeSet::get(F->getContext(), Index, B));
++#endif
+ }
+
+ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
+ unsigned Index,
+ LLVMRustAttribute
RustAttr) {
+ Function *F = unwrap<Function>(Fn);
+- const AttributeSet PAL = F->getAttributes();
+ Attribute Attr = Attribute::get(F->getContext(), fromRust(RustAttr));
+ AttrBuilder B(Attr);
++ auto PAL = F->getAttributes();
++#if LLVM_VERSION_GE(5, 0)
++ auto PALNew = PAL.removeAttributes(F->getContext(), Index, B);
++#else
+ const AttributeSet PALNew = PAL.removeAttributes(
+ F->getContext(), Index, AttributeSet::get(F->getContext(), Index, B));
++#endif
+ F->setAttributes(PALNew);
+ }
+
+--
+2.14.2
+
diff --git
a/devel/rust/patches/0004-rustllvm-split-DebugLoc-in-UnpackOptimizationDiagnos.patch

b/devel/rust/patches/0004-rustllvm-split-DebugLoc-in-UnpackOptimizationDiagnos.patch
new file mode 100644
index 0000000..de27bce
--- /dev/null
+++
b/devel/rust/patches/0004-rustllvm-split-DebugLoc-in-UnpackOptimizationDiagnos.patch
@@ -0,0 +1,195 @@
+From 1ee87b3765b4cc0ab78aec25009e4e5295024f93 Mon Sep 17 00:00:00 2001
+From: Tim Neumann <mail AT timnn.me>
+Date: Fri, 21 Jul 2017 14:29:23 +0200
+Subject: [PATCH] rustllvm: split DebugLoc in UnpackOptimizationDiagnostic
+
+---
+ src/librustc_llvm/diagnostic.rs | 32 +++++++++++++++++++++++---------
+ src/librustc_llvm/ffi.rs | 4 +++-
+ src/librustc_trans/back/write.rs | 14 ++++++--------
+ src/rustllvm/RustWrapper.cpp | 23 ++++++++++++++++++++---
+ 4 files changed, 52 insertions(+), 21 deletions(-)
+
+diff --git a/src/librustc_llvm/diagnostic.rs
b/src/librustc_llvm/diagnostic.rs
+index cef6199a74..c5276e0c97 100644
+--- a/src/librustc_llvm/diagnostic.rs
++++ b/src/librustc_llvm/diagnostic.rs
+@@ -17,7 +17,6 @@ use libc::c_uint;
+ use std::ptr;
+
+ use {DiagnosticInfoRef, TwineRef, ValueRef};
+-use ffi::DebugLocRef;
+
+ #[derive(Copy, Clone)]
+ pub enum OptimizationDiagnosticKind {
+@@ -47,7 +46,9 @@ pub struct OptimizationDiagnostic {
+ pub kind: OptimizationDiagnosticKind,
+ pub pass_name: String,
+ pub function: ValueRef,
+- pub debug_loc: DebugLocRef,
++ pub line: c_uint,
++ pub column: c_uint,
++ pub filename: String,
+ pub message: String,
+ }
+
+@@ -56,24 +57,37 @@ impl OptimizationDiagnostic {
+ di: DiagnosticInfoRef)
+ -> OptimizationDiagnostic {
+ let mut function = ptr::null_mut();
+- let mut debug_loc = ptr::null_mut();
++ let mut line = 0;
++ let mut column = 0;
+
+ let mut message = None;
++ let mut filename = None;
+ let pass_name = super::build_string(|pass_name|
+ message = super::build_string(|message|
+- super::LLVMRustUnpackOptimizationDiagnostic(di,
+- pass_name,
+- &mut function,
+- &mut debug_loc,
+- message)
++ filename = super::build_string(|filename|
++ super::LLVMRustUnpackOptimizationDiagnostic(di,
++ pass_name,
++ &mut
function,
++ &mut line,
++ &mut column,
++ filename,
++ message)
++ )
+ )
+ );
+
++ let mut filename = filename.unwrap_or(String::new());
++ if filename.is_empty() {
++ filename.push_str("<unknown file>");
++ }
++
+ OptimizationDiagnostic {
+ kind: kind,
+ pass_name: pass_name.expect("got a non-UTF8 pass name from
LLVM"),
+ function: function,
+- debug_loc: debug_loc,
++ line: line,
++ column: column,
++ filename: filename,
+ message: message.expect("got a non-UTF8 OptimizationDiagnostic
message from LLVM")
+ }
+ }
+diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs
+index 9f0ee95b5a..24d4040ccb 100644
+--- a/src/librustc_llvm/ffi.rs
++++ b/src/librustc_llvm/ffi.rs
+@@ -1633,7 +1633,9 @@ extern "C" {
+ pub fn LLVMRustUnpackOptimizationDiagnostic(DI: DiagnosticInfoRef,
+ pass_name_out:
RustStringRef,
+ function_out: *mut ValueRef,
+- debugloc_out: *mut
DebugLocRef,
++ loc_line_out: *mut c_uint,
++ loc_column_out: *mut c_uint,
++ loc_filename_out:
RustStringRef,
+ message_out: RustStringRef);
+ pub fn LLVMRustUnpackInlineAsmDiagnostic(DI: DiagnosticInfoRef,
+ cookie_out: *mut c_uint,
+diff --git a/src/librustc_trans/back/write.rs
b/src/librustc_trans/back/write.rs
+index 5e227ec467..26553c8502 100644
+--- a/src/librustc_trans/back/write.rs
++++ b/src/librustc_trans/back/write.rs
+@@ -16,7 +16,7 @@ use rustc::session::config::{self, OutputFilenames,
OutputType, OutputTypes, Pas
+ AllPasses, Sanitizer};
+ use rustc::session::Session;
+ use llvm;
+-use llvm::{ModuleRef, TargetMachineRef, PassManagerRef, DiagnosticInfoRef,
ContextRef};
++use llvm::{ModuleRef, TargetMachineRef, PassManagerRef, DiagnosticInfoRef};
+ use llvm::SMDiagnosticRef;
+ use {CrateTranslation, ModuleLlvm, ModuleSource, ModuleTranslation};
+ use rustc::hir::def_id::CrateNum;
+@@ -307,7 +307,6 @@ pub struct CodegenContext<'a> {
+ }
+
+ struct HandlerFreeVars<'a> {
+- llcx: ContextRef,
+ cgcx: &'a CodegenContext<'a>,
+ }
+
+@@ -329,7 +328,7 @@ unsafe extern "C" fn inline_asm_handler(diag:
SMDiagnosticRef,
+ }
+
+ unsafe extern "C" fn diagnostic_handler(info: DiagnosticInfoRef, user: *mut
c_void) {
+- let HandlerFreeVars { llcx, cgcx } = *(user as *const HandlerFreeVars);
++ let HandlerFreeVars { cgcx, .. } = *(user as *const HandlerFreeVars);
+
+ match llvm::diagnostic::Diagnostic::unpack(info) {
+ llvm::diagnostic::InlineAsm(inline) => {
+@@ -345,11 +344,12 @@ unsafe extern "C" fn diagnostic_handler(info:
DiagnosticInfoRef, user: *mut c_vo
+ };
+
+ if enabled {
+- let loc = llvm::debug_loc_to_string(llcx, opt.debug_loc);
+- cgcx.handler.note_without_error(&format!("optimization {}
for {} at {}: {}",
++ cgcx.handler.note_without_error(&format!("optimization {}
for {} at {}:{}:{}: {}",
+ opt.kind.describe(),
+ opt.pass_name,
+- if loc.is_empty() {
"[unknown]" } else { &*loc },
++ opt.filename,
++ opt.line,
++ opt.column,
+ opt.message));
+ }
+ }
+@@ -370,9 +370,7 @@ unsafe fn optimize_and_codegen(cgcx: &CodegenContext,
+ let llcx = mllvm.llcx;
+ let tm = config.tm;
+
+- // llcx doesn't outlive this function, so we can put this on the stack.
+ let fv = HandlerFreeVars {
+- llcx: llcx,
+ cgcx: cgcx,
+ };
+ let fv = &fv as *const HandlerFreeVars as *mut c_void;
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index 896c822450..94185b5432 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -906,8 +906,8 @@ extern "C" void LLVMRustWriteTwineToString(LLVMTwineRef
T, RustStringRef Str) {
+
+ extern "C" void LLVMRustUnpackOptimizationDiagnostic(
+ LLVMDiagnosticInfoRef DI, RustStringRef PassNameOut,
+- LLVMValueRef *FunctionOut, LLVMDebugLocRef *DebugLocOut,
+- RustStringRef MessageOut) {
++ LLVMValueRef *FunctionOut, unsigned* Line, unsigned* Column,
++ RustStringRef FilenameOut, RustStringRef MessageOut) {
+ // Undefined to call this not on an optimization diagnostic!
+ llvm::DiagnosticInfoOptimizationBase *Opt =
+ static_cast<llvm::DiagnosticInfoOptimizationBase *>(unwrap(DI));
+@@ -915,7 +915,24 @@ extern "C" void LLVMRustUnpackOptimizationDiagnostic(
+ RawRustStringOstream PassNameOS(PassNameOut);
+ PassNameOS << Opt->getPassName();
+ *FunctionOut = wrap(&Opt->getFunction());
+- *DebugLocOut = wrap(&Opt->getDebugLoc());
++
++ RawRustStringOstream FilenameOS(FilenameOut);
++#if LLVM_VERSION_GE(5,0)
++ DiagnosticLocation loc = Opt->getLocation();
++ if (loc.isValid()) {
++ *Line = loc.getLine();
++ *Column = loc.getColumn();
++ FilenameOS << loc.getFilename();
++ }
++#else
++ const DebugLoc &loc = Opt->getDebugLoc();
++ if (loc) {
++ *Line = loc.getLine();
++ *Column = loc.getCol();
++ FilenameOS << cast<DIScope>(loc.getScope())->getFilename();
++ }
++#endif
++
+ RawRustStringOstream MessageOS(MessageOut);
+ MessageOS << Opt->getMsg();
+ }
+--
+2.14.2
+
diff --git a/devel/rust/patches/0005-rustllvm-update-to-SyncScope-ID.patch
b/devel/rust/patches/0005-rustllvm-update-to-SyncScope-ID.patch
new file mode 100644
index 0000000..fb441c2
--- /dev/null
+++ b/devel/rust/patches/0005-rustllvm-update-to-SyncScope-ID.patch
@@ -0,0 +1,43 @@
+From a53676762bbe492154926393b187f0ee49df6e98 Mon Sep 17 00:00:00 2001
+From: Tim Neumann <mail AT timnn.me>
+Date: Fri, 21 Jul 2017 14:02:52 +0200
+Subject: [PATCH] rustllvm: update to SyncScope::ID
+
+---
+ src/rustllvm/RustWrapper.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index 1e39a0d6b3..896c822450 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -267,6 +267,18 @@ enum class LLVMRustSynchronizationScope {
+ CrossThread,
+ };
+
++#if LLVM_VERSION_GE(5, 0)
++static SyncScope::ID fromRust(LLVMRustSynchronizationScope Scope) {
++ switch (Scope) {
++ case LLVMRustSynchronizationScope::SingleThread:
++ return SyncScope::SingleThread;
++ case LLVMRustSynchronizationScope::CrossThread:
++ return SyncScope::System;
++ default:
++ llvm_unreachable("bad SynchronizationScope.");
++ }
++}
++#else
+ static SynchronizationScope fromRust(LLVMRustSynchronizationScope Scope) {
+ switch (Scope) {
+ case LLVMRustSynchronizationScope::SingleThread:
+@@ -277,6 +289,7 @@ static SynchronizationScope
fromRust(LLVMRustSynchronizationScope Scope) {
+ llvm_unreachable("bad SynchronizationScope.");
+ }
+ }
++#endif
+
+ extern "C" LLVMValueRef
+ LLVMRustBuildAtomicFence(LLVMBuilderRef B, LLVMAtomicOrdering Order,
+--
+2.14.2
+
diff --git
a/devel/rust/patches/0006-rustllvm-adjust-usage-of-createNameSpace.patch
b/devel/rust/patches/0006-rustllvm-adjust-usage-of-createNameSpace.patch
new file mode 100644
index 0000000..c37cda5
--- /dev/null
+++ b/devel/rust/patches/0006-rustllvm-adjust-usage-of-createNameSpace.patch
@@ -0,0 +1,29 @@
+From 48424c97490b3a449c57d8540529af4971386c4a Mon Sep 17 00:00:00 2001
+From: Tim Neumann <mail AT timnn.me>
+Date: Fri, 21 Jul 2017 13:31:19 +0200
+Subject: [PATCH] rustllvm: adjust usage of createNameSpace
+
+---
+ src/rustllvm/RustWrapper.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index 7c3746c4c2..1e39a0d6b3 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -753,7 +753,11 @@ LLVMRustDIBuilderCreateNameSpace(LLVMRustDIBuilderRef
Builder,
+ LLVMMetadataRef Scope, const char *Name,
+ LLVMMetadataRef File, unsigned LineNo) {
+ return wrap(Builder->createNameSpace(
+- unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), LineNo
++ unwrapDI<DIDescriptor>(Scope), Name
++#if LLVM_VERSION_LT(5, 0)
++ ,
++ unwrapDI<DIFile>(File), LineNo
++#endif
+ #if LLVM_VERSION_GE(4, 0)
+ ,
+ false // ExportSymbols (only relevant for C++ anonymous namespaces)
+--
+2.14.2
+
diff --git
a/devel/rust/patches/0007-rustllvm-adjust-usage-of-createPointerType.patch
b/devel/rust/patches/0007-rustllvm-adjust-usage-of-createPointerType.patch
new file mode 100644
index 0000000..124eb91
--- /dev/null
+++ b/devel/rust/patches/0007-rustllvm-adjust-usage-of-createPointerType.patch
@@ -0,0 +1,40 @@
+From 5f9e432534d54aebc2fa45f83becd13bccafa2d7 Mon Sep 17 00:00:00 2001
+From: Tim Neumann <mail AT timnn.me>
+Date: Fri, 21 Jul 2017 13:26:41 +0200
+Subject: [PATCH] rustllvm: adjust usage of createPointerType
+
+---
+ src/rustllvm/RustWrapper.cpp | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index 401bd99f7b..7c3746c4c2 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -18,6 +18,10 @@
+
+ #include "llvm/IR/CallSite.h"
+
++#if LLVM_VERSION_GE(5, 0)
++#include "llvm/ADT/Optional.h"
++#endif
++
+
//===----------------------------------------------------------------------===
+ //
+ // This file defines alternate interfaces to core functions that are more
+@@ -557,7 +561,11 @@ extern "C" LLVMMetadataRef
LLVMRustDIBuilderCreatePointerType(
+ LLVMRustDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
+ uint64_t SizeInBits, uint32_t AlignInBits, const char *Name) {
+ return wrap(Builder->createPointerType(unwrapDI<DIType>(PointeeTy),
+- SizeInBits, AlignInBits, Name));
++ SizeInBits, AlignInBits,
++#if LLVM_VERSION_GE(5, 0)
++ /* DWARFAddressSpace */ None,
++#endif
++ Name));
+ }
+
+ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStructType(
+--
+2.14.2
+
diff --git a/devel/rust/patches/0008-rustllvm-use-LLVMMetadataRef.patch
b/devel/rust/patches/0008-rustllvm-use-LLVMMetadataRef.patch
new file mode 100644
index 0000000..43c7355
--- /dev/null
+++ b/devel/rust/patches/0008-rustllvm-use-LLVMMetadataRef.patch
@@ -0,0 +1,338 @@
+From 2c9c8dc5f46bd2db5a5b81acca72a23de75502ec Mon Sep 17 00:00:00 2001
+From: Tim Neumann <mail AT timnn.me>
+Date: Fri, 21 Jul 2017 13:15:36 +0200
+Subject: [PATCH] rustllvm: use LLVMMetadataRef
+
+---
+ src/rustllvm/RustWrapper.cpp | 148
++++++++++++++++++++++---------------------
+ 1 file changed, 75 insertions(+), 73 deletions(-)
+
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index c11c5f4186..401bd99f7b 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -360,17 +360,19 @@
+
+ typedef DIBuilder *LLVMRustDIBuilderRef;
+
+-typedef struct LLVMOpaqueMetadata *LLVMRustMetadataRef;
++#if LLVM_VERSION_LT(5, 0)
++typedef struct LLVMOpaqueMetadata *LLVMMetadataRef;
+
+ namespace llvm {
+-DEFINE_ISA_CONVERSION_FUNCTIONS(Metadata, LLVMRustMetadataRef)
++DEFINE_ISA_CONVERSION_FUNCTIONS(Metadata, LLVMMetadataRef)
+
+-inline Metadata **unwrap(LLVMRustMetadataRef *Vals) {
++inline Metadata **unwrap(LLVMMetadataRef *Vals) {
+ return reinterpret_cast<Metadata **>(Vals);
+ }
+ }
++#endif
+
+-template <typename DIT> DIT *unwrapDIPtr(LLVMRustMetadataRef Ref) {
++template <typename DIT> DIT *unwrapDIPtr(LLVMMetadataRef Ref) {
+ return (DIT *)(Ref ? unwrap<MDNode>(Ref) : nullptr);
+ }
+
+@@ -508,7 +510,7 @@
+ unwrap(M)->addModuleFlag(Module::Warning, Name, Value);
+ }
+
+-extern "C" void LLVMRustMetadataAsValue(LLVMContextRef C,
LLVMRustMetadataRef MD) {
++extern "C" void LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef
MD) {
+ wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD)));
+ }
+
+@@ -524,8 +526,8 @@
+ Builder->finalize();
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateCompileUnit(
+- LLVMRustDIBuilderRef Builder, unsigned Lang, LLVMRustMetadataRef
FileRef,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateCompileUnit(
++ LLVMRustDIBuilderRef Builder, unsigned Lang, LLVMMetadataRef FileRef,
+ const char *Producer, bool isOptimized, const char *Flags,
+ unsigned RuntimeVer, const char *SplitName) {
+ auto *File = unwrapDI<DIFile>(FileRef);
+@@ -540,16 +542,16 @@
+ #endif
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateFile(LLVMRustDIBuilderRef Builder, const char
*Filename,
+ const char *Directory) {
+ return wrap(Builder->createFile(Filename, Directory));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateSubroutineType(LLVMRustDIBuilderRef Builder,
+- LLVMRustMetadataRef File,
+- LLVMRustMetadataRef ParameterTypes) {
++ LLVMMetadataRef File,
++ LLVMMetadataRef ParameterTypes) {
+ return wrap(Builder->createSubroutineType(
+ #if LLVM_VERSION_EQ(3, 7)
+ unwrapDI<DIFile>(File),
+@@ -557,12 +559,12 @@
+ DITypeRefArray(unwrap<MDTuple>(ParameterTypes))));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateFunction(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope, const char
*Name,
+- const char *LinkageName, LLVMRustMetadataRef File, unsigned LineNo,
+- LLVMRustMetadataRef Ty, bool IsLocalToUnit, bool IsDefinition,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFunction(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
++ const char *LinkageName, LLVMMetadataRef File, unsigned LineNo,
++ LLVMMetadataRef Ty, bool IsLocalToUnit, bool IsDefinition,
+ unsigned ScopeLine, LLVMRustDIFlags Flags, bool IsOptimized,
+- LLVMValueRef Fn, LLVMRustMetadataRef TParam, LLVMRustMetadataRef Decl) {
++ LLVMValueRef Fn, LLVMMetadataRef TParam, LLVMMetadataRef Decl) {
+ #if LLVM_VERSION_GE(3, 8)
+ DITemplateParameterArray TParams =
+ DITemplateParameterArray(unwrap<MDTuple>(TParam));
+@@ -582,7 +584,7 @@
+ #endif
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateBasicType(LLVMRustDIBuilderRef Builder, const char
*Name,
+ uint64_t SizeInBits, uint32_t AlignInBits,
+ unsigned Encoding) {
+@@ -593,8 +595,8 @@
+ Encoding));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreatePointerType(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef PointeeTy,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreatePointerType(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
+ uint64_t SizeInBits, uint32_t AlignInBits, const char *Name) {
+ return wrap(Builder->createPointerType(unwrapDI<DIType>(PointeeTy),
+ SizeInBits, AlignInBits,
+@@ -604,12 +606,12 @@
+ Name));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateStructType(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope, const char
*Name,
+- LLVMRustMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStructType(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
++ LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
+ uint32_t AlignInBits, LLVMRustDIFlags Flags,
+- LLVMRustMetadataRef DerivedFrom, LLVMRustMetadataRef Elements,
+- unsigned RunTimeLang, LLVMRustMetadataRef VTableHolder,
++ LLVMMetadataRef DerivedFrom, LLVMMetadataRef Elements,
++ unsigned RunTimeLang, LLVMMetadataRef VTableHolder,
+ const char *UniqueId) {
+ return wrap(Builder->createStructType(
+ unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File),
LineNumber,
+@@ -618,37 +620,37 @@
+ unwrapDI<DIType>(VTableHolder), UniqueId));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateMemberType(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope, const char
*Name,
+- LLVMRustMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateMemberType(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
++ LLVMMetadataRef File, unsigned LineNo, uint64_t SizeInBits,
+ uint32_t AlignInBits, uint64_t OffsetInBits, LLVMRustDIFlags Flags,
+- LLVMRustMetadataRef Ty) {
++ LLVMMetadataRef Ty) {
+ return wrap(Builder->createMemberType(unwrapDI<DIDescriptor>(Scope), Name,
+ unwrapDI<DIFile>(File), LineNo,
+ SizeInBits, AlignInBits,
OffsetInBits,
+ fromRust(Flags),
unwrapDI<DIType>(Ty)));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateLexicalBlock(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope,
+- LLVMRustMetadataRef File, unsigned Line, unsigned Col) {
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateLexicalBlock(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope,
++ LLVMMetadataRef File, unsigned Line, unsigned Col) {
+ return wrap(Builder->createLexicalBlock(unwrapDI<DIDescriptor>(Scope),
+ unwrapDI<DIFile>(File), Line,
Col));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateLexicalBlockFile(LLVMRustDIBuilderRef Builder,
+- LLVMRustMetadataRef Scope,
+- LLVMRustMetadataRef File) {
++ LLVMMetadataRef Scope,
++ LLVMMetadataRef File) {
+ return wrap(Builder->createLexicalBlockFile(unwrapDI<DIDescriptor>(Scope),
+ unwrapDI<DIFile>(File)));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateStaticVariable(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Context, const char
*Name,
+- const char *LinkageName, LLVMRustMetadataRef File, unsigned LineNo,
+- LLVMRustMetadataRef Ty, bool IsLocalToUnit, LLVMValueRef V,
+- LLVMRustMetadataRef Decl = nullptr, uint32_t AlignInBits = 0) {
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Context, const char *Name,
++ const char *LinkageName, LLVMMetadataRef File, unsigned LineNo,
++ LLVMMetadataRef Ty, bool IsLocalToUnit, LLVMValueRef V,
++ LLVMMetadataRef Decl = nullptr, uint32_t AlignInBits = 0) {
+ llvm::GlobalVariable *InitVal = cast<llvm::GlobalVariable>(unwrap(V));
+
+ #if LLVM_VERSION_GE(4, 0)
+@@ -678,10 +680,10 @@
+ #endif
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateVariable(
+- LLVMRustDIBuilderRef Builder, unsigned Tag, LLVMRustMetadataRef Scope,
+- const char *Name, LLVMRustMetadataRef File, unsigned LineNo,
+- LLVMRustMetadataRef Ty, bool AlwaysPreserve, LLVMRustDIFlags Flags,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
++ LLVMRustDIBuilderRef Builder, unsigned Tag, LLVMMetadataRef Scope,
++ const char *Name, LLVMMetadataRef File, unsigned LineNo,
++ LLVMMetadataRef Ty, bool AlwaysPreserve, LLVMRustDIFlags Flags,
+ unsigned ArgNo, uint32_t AlignInBits) {
+ #if LLVM_VERSION_GE(3, 8)
+ if (Tag == 0x100) { // DW_TAG_auto_variable
+@@ -705,40 +707,40 @@
+ #endif
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateArrayType(LLVMRustDIBuilderRef Builder, uint64_t
Size,
+- uint32_t AlignInBits, LLVMRustMetadataRef
Ty,
+- LLVMRustMetadataRef Subscripts) {
++ uint32_t AlignInBits, LLVMMetadataRef Ty,
++ LLVMMetadataRef Subscripts) {
+ return wrap(
+ Builder->createArrayType(Size, AlignInBits, unwrapDI<DIType>(Ty),
+ DINodeArray(unwrapDI<MDTuple>(Subscripts))));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateVectorType(LLVMRustDIBuilderRef Builder, uint64_t
Size,
+- uint32_t AlignInBits, LLVMRustMetadataRef
Ty,
+- LLVMRustMetadataRef Subscripts) {
++ uint32_t AlignInBits, LLVMMetadataRef Ty,
++ LLVMMetadataRef Subscripts) {
+ return wrap(
+ Builder->createVectorType(Size, AlignInBits, unwrapDI<DIType>(Ty),
+
DINodeArray(unwrapDI<MDTuple>(Subscripts))));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderGetOrCreateSubrange(LLVMRustDIBuilderRef Builder, int64_t
Lo,
+ int64_t Count) {
+ return wrap(Builder->getOrCreateSubrange(Lo, Count));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderGetOrCreateArray(LLVMRustDIBuilderRef Builder,
+- LLVMRustMetadataRef *Ptr, unsigned Count)
{
++ LLVMMetadataRef *Ptr, unsigned Count) {
+ Metadata **DataValue = unwrap(Ptr);
+ return wrap(
+ Builder->getOrCreateArray(ArrayRef<Metadata *>(DataValue,
Count)).get());
+ }
+
+ extern "C" LLVMValueRef LLVMRustDIBuilderInsertDeclareAtEnd(
+- LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMRustMetadataRef
VarInfo,
++ LLVMRustDIBuilderRef Builder, LLVMValueRef V, LLVMMetadataRef VarInfo,
+ int64_t *AddrOps, unsigned AddrOpsCount, LLVMValueRef DL,
+ LLVMBasicBlockRef InsertAtEnd) {
+ return wrap(Builder->insertDeclare(
+@@ -748,27 +750,27 @@
+ unwrap(InsertAtEnd)));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateEnumerator(LLVMRustDIBuilderRef Builder,
+ const char *Name, uint64_t Val) {
+ return wrap(Builder->createEnumerator(Name, Val));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateEnumerationType(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope, const char
*Name,
+- LLVMRustMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
+- uint32_t AlignInBits, LLVMRustMetadataRef Elements,
+- LLVMRustMetadataRef ClassTy) {
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateEnumerationType(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
++ LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
++ uint32_t AlignInBits, LLVMMetadataRef Elements,
++ LLVMMetadataRef ClassTy) {
+ return wrap(Builder->createEnumerationType(
+ unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File),
LineNumber,
+ SizeInBits, AlignInBits, DINodeArray(unwrapDI<MDTuple>(Elements)),
+ unwrapDI<DIType>(ClassTy)));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateUnionType(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope, const char
*Name,
+- LLVMRustMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
+- uint32_t AlignInBits, LLVMRustDIFlags Flags, LLVMRustMetadataRef
Elements,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateUnionType(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
++ LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
++ uint32_t AlignInBits, LLVMRustDIFlags Flags, LLVMMetadataRef Elements,
+ unsigned RunTimeLang, const char *UniqueId) {
+ return wrap(Builder->createUnionType(
+ unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File),
LineNumber,
+@@ -776,18 +778,18 @@
+ DINodeArray(unwrapDI<MDTuple>(Elements)), RunTimeLang, UniqueId));
+ }
+
+-extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateTemplateTypeParameter(
+- LLVMRustDIBuilderRef Builder, LLVMRustMetadataRef Scope, const char
*Name,
+- LLVMRustMetadataRef Ty, LLVMRustMetadataRef File, unsigned LineNo,
++extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateTemplateTypeParameter(
++ LLVMRustDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
++ LLVMMetadataRef Ty, LLVMMetadataRef File, unsigned LineNo,
+ unsigned ColumnNo) {
+ return wrap(Builder->createTemplateTypeParameter(
+ unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIType>(Ty)));
+ }
+
+-extern "C" LLVMRustMetadataRef
++extern "C" LLVMMetadataRef
+ LLVMRustDIBuilderCreateNameSpace(LLVMRustDIBuilderRef Builder,
+- LLVMRustMetadataRef Scope, const char
*Name,
+- LLVMRustMetadataRef File, unsigned LineNo)
{
++ LLVMMetadataRef Scope, const char *Name,
++ LLVMMetadataRef File, unsigned LineNo) {
+ return wrap(Builder->createNameSpace(
+ unwrapDI<DIDescriptor>(Scope), Name
+ #if LLVM_VERSION_LT(5, 0)
+@@ -803,16 +805,16 @@
+
+ extern "C" void
+ LLVMRustDICompositeTypeSetTypeArray(LLVMRustDIBuilderRef Builder,
+- LLVMRustMetadataRef CompositeTy,
+- LLVMRustMetadataRef TyArray) {
++ LLVMMetadataRef CompositeTy,
++ LLVMMetadataRef TyArray) {
+ DICompositeType *Tmp = unwrapDI<DICompositeType>(CompositeTy);
+ Builder->replaceArrays(Tmp, DINodeArray(unwrap<MDTuple>(TyArray)));
+ }
+
+ extern "C" LLVMValueRef
+ LLVMRustDIBuilderCreateDebugLocation(LLVMContextRef ContextRef, unsigned
Line,
+- unsigned Column, LLVMRustMetadataRef
Scope,
+- LLVMRustMetadataRef InlinedAt) {
++ unsigned Column, LLVMMetadataRef Scope,
++ LLVMMetadataRef InlinedAt) {
+ LLVMContext &Context = *unwrap(ContextRef);
+
+ DebugLoc debug_loc = DebugLoc::get(Line, Column,
unwrapDIPtr<MDNode>(Scope),
+-- 2.14.2
diff --git a/devel/rust/patches/0009-rustllvm-define-LLVM_VERSION_LT.patch
b/devel/rust/patches/0009-rustllvm-define-LLVM_VERSION_LT.patch
new file mode 100644
index 0000000..2444bbb
--- /dev/null
+++ b/devel/rust/patches/0009-rustllvm-define-LLVM_VERSION_LT.patch
@@ -0,0 +1,25 @@
+From c9787296f8198b50c89a5e655bbd81576c3e1d06 Mon Sep 17 00:00:00 2001
+From: Tim Neumann <mail AT timnn.me>
+Date: Fri, 21 Jul 2017 13:13:37 +0200
+Subject: [PATCH] rustllvm: define LLVM_VERSION_LT
+
+---
+ src/rustllvm/rustllvm.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/rustllvm/rustllvm.h b/src/rustllvm/rustllvm.h
+index 0baf5528e9..20816af2f1 100644
+--- a/src/rustllvm/rustllvm.h
++++ b/src/rustllvm/rustllvm.h
+@@ -55,6 +55,8 @@
+ (LLVM_VERSION_MAJOR < (major) ||
\
+ LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR <= (minor))
+
++#define LLVM_VERSION_LT(major, minor) (!LLVM_VERSION_GE((major), (minor)))
++
+ #if LLVM_VERSION_GE(3, 7)
+ #include "llvm/IR/LegacyPassManager.h"
+ #else
+--
+2.14.2
+



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (1ba31e53eee270b8103455a523c5869c21197a19), Pavel Vinogradov, 09/28/2017

Archive powered by MHonArc 2.6.24.

Top of Page