Skip to content

Commit c7c292b

Browse files
committed
Don't emit range metadata on calls with LLVM 3.9 🤔
1 parent 555d16e commit c7c292b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/librustc_trans/abi.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,11 @@ impl<'a, 'tcx> FnType<'tcx> {
10621062
match scalar.value {
10631063
layout::Int(..) if !scalar.is_bool() => {
10641064
if let Some(range) = scalar.range_metadata(bx.cx) {
1065-
bx.range_metadata(callsite, range);
1065+
// FIXME(nox): This causes very weird type errors about
1066+
// SHL operators in constants in stage 2 with LLVM 3.9.
1067+
if unsafe { llvm::LLVMRustVersionMajor() >= 4 } {
1068+
bx.range_metadata(callsite, range);
1069+
}
10661070
}
10671071
}
10681072
_ => {}

src/test/codegen/call-metadata.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// scalar value.
1313

1414
// compile-flags: -C no-prepopulate-passes
15+
// min-llvm-version 4.0
16+
1517

1618
#![crate_type = "lib"]
1719

0 commit comments

Comments
 (0)