Skip to content

Commit c931981

Browse files
committed
---
yaml --- r: 102395 b: refs/heads/master c: fb80b38 h: refs/heads/master i: 102393: d3d2c2d 102391: d71ff35 v: v3
1 parent d416c5b commit c931981

File tree

5 files changed

+64
-15
lines changed

5 files changed

+64
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1c52c81846246e135557f1aa6db5bef4140c8717
2+
refs/heads/master: fb80b384f4b6611ce4d880991a1026e93acdd6f7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/.travis.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,28 @@ language: c
55

66
# Before we start doing anything, install a stock LLVM
77
install:
8-
- sudo apt-get install llvm-3.3 llvm-3.3-dev clang-3.3 lldb-3.3
8+
- sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main' >> /etc/apt/sources.list"
9+
- sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list"
10+
- sudo sh -c "echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main' >> /etc/apt/sources.list"
11+
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
12+
- sudo apt-get update -qq
13+
- sudo apt-get install -qq --force-yes -y llvm-$LLVM_VERSION
14+
llvm-${LLVM_VERSION}-dev clang-$LLVM_VERSION lldb-$LLVM_VERSION
915

10-
# All of the llvm tools are suffixed with "-3.3" which we don't want, so symlink
11-
# them all into a local directory and just use that
16+
17+
# All of the llvm tools are suffixed with "-$VERS" which we don't want, so
18+
# symlink them all into a local directory and just use that
1219
#
1320
# FIXME: this shouldn't update the src/llvm sub-repo, that takes about a minute
1421
# it's gotta download so much stuff.
1522
before_script:
1623
- mkdir -p local-llvm/bin
17-
- ln -nsf /usr/bin/llvm-config-3.3 local-llvm/bin/llvm-config
18-
- ln -nsf /usr/bin/llvm-mc-3.3 local-llvm/bin/llvm-mc
19-
- ln -nsf /usr/bin/llvm-as-3.3 local-llvm/bin/llvm-as
20-
- ln -nsf /usr/bin/llvm-dis-3.3 local-llvm/bin/llvm-dis
21-
- ln -nsf /usr/bin/llc-3.3 local-llvm/bin/llc
22-
- ln -nsf /usr/include/llvm-3.3 local-llvm/include
24+
- ln -nsf /usr/bin/llvm-config-$LLVM_VERSION local-llvm/bin/llvm-config
25+
- ln -nsf /usr/bin/llvm-mc-$LLVM_VERSION local-llvm/bin/llvm-mc
26+
- ln -nsf /usr/bin/llvm-as-$LLVM_VERSION local-llvm/bin/llvm-as
27+
- ln -nsf /usr/bin/llvm-dis-$LLVM_VERSION local-llvm/bin/llvm-dis
28+
- ln -nsf /usr/bin/llc-$LLVM_VERSION local-llvm/bin/llc
29+
- ln -nsf /usr/include/llvm-$LLVM_VERSION local-llvm/include
2330
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm --enable-fast-make --enable-clang
2431

2532
# Tidy everything up first, then build a few things, and then run a few tests.
@@ -29,14 +36,28 @@ before_script:
2936
# As a result of https://github.com/travis-ci/travis-ci/issues/1066, we run
3037
# everything in one large command instead of multiple commands.
3138
script: |
39+
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then
40+
if [[ $LLVM_VERSION != '3.4' ]]; then exit 0; fi
41+
fi &&
3242
make tidy &&
3343
make -j4 rustc-stage1 &&
3444
make check-stage1-std check-stage1-rpass check-stage1-cfail check-stage1-rfail
3545
3646
env:
37-
- NO_BENCH=1
47+
global:
48+
- NO_BENCH=1
49+
matrix:
50+
- LLVM_VERSION=3.3
51+
- LLVM_VERSION=3.4
3852

3953
# We track this ourselves, and in theory we don't have to update the LLVM repo
4054
# (but sadly we do right now anyway).
4155
git:
4256
submodules: false
57+
58+
notifications:
59+
email: false
60+
61+
branches:
62+
only:
63+
- master

trunk/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,7 @@ pub mod llvm {
17711771
pub fn LLVMRustDestroyArchive(AR: ArchiveRef);
17721772

17731773
pub fn LLVMRustSetDLLExportStorageClass(V: ValueRef);
1774+
pub fn LLVMVersionMinor() -> c_int;
17741775
}
17751776
}
17761777

trunk/src/librustc/middle/trans/base.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,8 +2286,6 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
22862286

22872287
ifn!(intrinsics, "llvm.fabs.f32", [Type::f32()], Type::f32());
22882288
ifn!(intrinsics, "llvm.fabs.f64", [Type::f64()], Type::f64());
2289-
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32(), Type::f32()], Type::f32());
2290-
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64(), Type::f64()], Type::f64());
22912289

22922290
ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
22932291
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
@@ -2300,8 +2298,6 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
23002298
ifn!(intrinsics, "llvm.rint.f64", [Type::f64()], Type::f64());
23012299
ifn!(intrinsics, "llvm.nearbyint.f32", [Type::f32()], Type::f32());
23022300
ifn!(intrinsics, "llvm.nearbyint.f64", [Type::f64()], Type::f64());
2303-
ifn!(intrinsics, "llvm.round.f32", [Type::f32()], Type::f32());
2304-
ifn!(intrinsics, "llvm.round.f64", [Type::f64()], Type::f64());
23052301

23062302
ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
23072303
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());
@@ -2378,6 +2374,32 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
23782374

23792375
ifn!(intrinsics, "llvm.expect.i1", [Type::i1(), Type::i1()], Type::i1());
23802376

2377+
// Some intrinsics were introduced in later versions of LLVM, but they have
2378+
// fallbacks in libc or libm and such. Currently, all of these intrinsics
2379+
// were introduced in LLVM 3.4, so we case on that.
2380+
macro_rules! compatible_ifn (
2381+
($intrinsics:ident, $name:expr, $cname:expr, $args:expr, $ret:expr) => ({
2382+
let name = $name;
2383+
if unsafe { llvm::LLVMVersionMinor() >= 4 } {
2384+
ifn!($intrinsics, $name, $args, $ret);
2385+
} else {
2386+
let f = decl_cdecl_fn(llmod, $cname,
2387+
Type::func($args, &$ret),
2388+
ty::mk_nil());
2389+
$intrinsics.insert(name, f);
2390+
}
2391+
})
2392+
)
2393+
2394+
compatible_ifn!(intrinsics, "llvm.copysign.f32", "copysignf",
2395+
[Type::f32(), Type::f32()], Type::f32());
2396+
compatible_ifn!(intrinsics, "llvm.copysign.f64", "copysign",
2397+
[Type::f64(), Type::f64()], Type::f64());
2398+
compatible_ifn!(intrinsics, "llvm.round.f32", "roundf",
2399+
[Type::f32()], Type::f32());
2400+
compatible_ifn!(intrinsics, "llvm.round.f64", "round",
2401+
[Type::f64()], Type::f64());
2402+
23812403
return intrinsics;
23822404
}
23832405

trunk/src/rustllvm/RustWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,3 +652,8 @@ LLVMRustSetDLLExportStorageClass(LLVMValueRef Value) {
652652
LLVMSetLinkage(Value, LLVMDLLExportLinkage);
653653
}
654654
#endif
655+
656+
extern "C" int
657+
LLVMVersionMinor() {
658+
return LLVM_VERSION_MINOR;
659+
}

0 commit comments

Comments
 (0)