diff options
| author | gnzlbg <gonzalobg88@gmail.com> | 2018-06-29 10:28:51 +0200 |
|---|---|---|
| committer | gnzlbg <gonzalobg88@gmail.com> | 2018-07-09 11:35:52 +0200 |
| commit | 4ff90c7e0aa60cfab0d4fd5e52fcc63a7afd81c3 (patch) | |
| tree | 6d0fa0d1dc1055811868051d41edaeeca52d2a5c /src/librustc_codegen_llvm | |
| parent | ec039c7cb14e75866f7943845fc370205f4e4fd4 (diff) | |
| download | rust-4ff90c7e0aa60cfab0d4fd5e52fcc63a7afd81c3.tar.gz rust-4ff90c7e0aa60cfab0d4fd5e52fcc63a7afd81c3.zip | |
bump minimum LLVM version to 5.0
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/abi.rs | 6 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/mir/mod.rs | 22 |
2 files changed, 5 insertions, 23 deletions
diff --git a/src/librustc_codegen_llvm/abi.rs b/src/librustc_codegen_llvm/abi.rs index 6b5baa402b4..47c13919e6e 100644 --- a/src/librustc_codegen_llvm/abi.rs +++ b/src/librustc_codegen_llvm/abi.rs @@ -666,11 +666,7 @@ impl<'a, 'tcx> FnTypeExt<'a, 'tcx> for FnType<'tcx, Ty<'tcx>> { layout::Int(..) if !scalar.is_bool() => { let range = scalar.valid_range_exclusive(bx.cx); if range.start != range.end { - // FIXME(nox): This causes very weird type errors about - // SHL operators in constants in stage 2 with LLVM 3.9. - if unsafe { llvm::LLVMRustVersionMajor() >= 4 } { - bx.range_metadata(callsite, range); - } + bx.range_metadata(callsite, range); } } _ => {} diff --git a/src/librustc_codegen_llvm/mir/mod.rs b/src/librustc_codegen_llvm/mir/mod.rs index f9be91b4f3f..608539dd3fa 100644 --- a/src/librustc_codegen_llvm/mir/mod.rs +++ b/src/librustc_codegen_llvm/mir/mod.rs @@ -22,7 +22,7 @@ use builder::Builder; use common::{CodegenCx, Funclet}; use debuginfo::{self, declare_local, VariableAccess, VariableKind, FunctionDebugContext}; use monomorphize::Instance; -use abi::{ArgAttribute, ArgTypeExt, FnType, FnTypeExt, PassMode}; +use abi::{ArgTypeExt, FnType, FnTypeExt, PassMode}; use type_::Type; use syntax_pos::{DUMMY_SP, NO_EXPANSION, BytePos, Span}; @@ -430,10 +430,6 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, None }; - let deref_op = unsafe { - [llvm::LLVMRustDIBuilderCreateOpDeref()] - }; - mir.args_iter().enumerate().map(|(arg_index, local)| { let arg_decl = &mir.local_decls[local]; @@ -543,21 +539,11 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, if arg_index > 0 || mir.upvar_decls.is_empty() { // The Rust ABI passes indirect variables using a pointer and a manual copy, so we // need to insert a deref here, but the C ABI uses a pointer and a copy using the - // byval attribute, for which LLVM does the deref itself, so we must not add it. - // Starting with D31439 in LLVM 5, it *always* does the deref itself. - let mut variable_access = VariableAccess::DirectVariable { + // byval attribute, for which LLVM always does the deref itself, + // so we must not add it. + let variable_access = VariableAccess::DirectVariable { alloca: place.llval }; - if unsafe { llvm::LLVMRustVersionMajor() < 5 } { - if let PassMode::Indirect(ref attrs) = arg.mode { - if !attrs.contains(ArgAttribute::ByVal) { - variable_access = VariableAccess::IndirectVariable { - alloca: place.llval, - address_operations: &deref_op, - }; - } - } - } declare_local( bx, |
