Skip to content

Commit

Permalink
Don't emit range metadata on calls with LLVM 3.9 🤔
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Apr 24, 2018
1 parent 555d16e commit c7c292b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_trans/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,11 @@ impl<'a, 'tcx> FnType<'tcx> {
match scalar.value {
layout::Int(..) if !scalar.is_bool() => {
if let Some(range) = scalar.range_metadata(bx.cx) {
bx.range_metadata(callsite, range);
// 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);
}
}
}
_ => {}
Expand Down
2 changes: 2 additions & 0 deletions src/test/codegen/call-metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// scalar value.

// compile-flags: -C no-prepopulate-passes
// min-llvm-version 4.0


#![crate_type = "lib"]

Expand Down

0 comments on commit c7c292b

Please sign in to comment.