Skip to content

Commit 3fb191c

Browse files
committed
Update LLVM to pull in patch that removes extraneous null check.
1 parent e1cec5d commit 3fb191c

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

src/rustllvm/llvm-rebuild-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2017-03-23
4+
2017-03-28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -O
12+
13+
// See issue #37945.
14+
15+
#![crate_type = "lib"]
16+
17+
use std::slice::Iter;
18+
19+
// CHECK-LABEL: @is_empty_1
20+
#[no_mangle]
21+
pub fn is_empty_1(xs: Iter<f32>) -> bool {
22+
// CHECK-NOT: icmp eq float* {{.*}}, null
23+
{xs}.next().is_none()
24+
}
25+
26+
// CHECK-LABEL: @is_empty_2
27+
#[no_mangle]
28+
pub fn is_empty_2(xs: Iter<f32>) -> bool {
29+
// CHECK-NOT: icmp eq float* {{.*}}, null
30+
xs.map(|&x| x).next().is_none()
31+
}

0 commit comments

Comments
 (0)