Commit Graph

338 Commits

Author SHA1 Message Date
Vadzim Dambrouski
c0e82ad177 LLVM: Update submodule to rust-llvm-2016-10-29 branch. 2016-10-29 18:56:20 +03:00
Raph Levien
b8697d939a Update llvm-auto-clean-trigger
Update the datestamp so that buildbots do a clean rebuild of llvm.
2016-10-19 10:11:00 -07:00
Eduard-Mihai Burtescu
fc8f9b950b Rollup merge of #37182 - alexcrichton:appveyor, r=brson
Add AppVeyor configuration to the repo

We hope to move to AppVeyor in the near future off of Buildbot + EC2. This adds
an `appveyor.yml` configuration file which is ready to run builds on the auto
branch. This is also accompanied with a few minor fixes to the build system and
such to accomodate AppVeyor.

The intention is that we're not switching over to AppVeyor entirely just yet,
but rather we'll watch the builds for a week or so. If everything checks out
then we'll start gating on AppVeyor instead of Buildbot!
2016-10-19 08:00:00 +03:00
Alex Crichton
06d173adb7 Add AppVeyor configuration to the repo
We hope to move to AppVeyor in the near future off of Buildbot + EC2. This adds
an `appveyor.yml` configuration file which is ready to run builds on the auto
branch. This is also accompanied with a few minor fixes to the build system and
such to accomodate AppVeyor.

The intention is that we're not switching over to AppVeyor entirely just yet,
but rather we'll watch the builds for a week or so. If everything checks out
then we'll start gating on AppVeyor instead of Buildbot!
2016-10-14 20:33:20 -07:00
Michael Woerister
db4a9b3446 debuginfo: Remove some outdated stuff from LLVM DIBuilder binding. 2016-10-14 14:56:33 -04:00
Michael Woerister
7d03badb2a LLVM: Backport "[SimplifyCFG] Correctly test for unconditional branches in GetCaseResults" 2016-10-10 11:12:29 -04:00
Michael Woerister
7fcc1246c6 llvm: Update LLVM to include fix for pathologic case in its LiveDebugValues pass. 2016-10-07 17:14:30 -04:00
Brian Anderson
10a52d507d Update LLVM with fastcomp patches 2016-09-30 14:02:49 -07:00
Jake Goulding
e6e117c33a Extend preprocessor LLVM version checks to support LLVM 4.x
This doesn't actually do anything for LLVM 4.x yet, but sets the stage.
2016-09-26 13:40:29 -04:00
Simonas Kazlauskas
d104e5bfb7 Up the LLVM
Fixes #36474
2016-09-17 18:40:40 +03:00
Matt Ickstadt
b9a8c1a063 Fix incorrect LLVM Linkage enum
The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the #[linkage=""] attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Fixes #33992
2016-09-04 16:12:01 -05:00
Eduard Burtescu
f5c7752742 Fix optimization regressions for operations on [x; n]-initialized arrays. 2016-09-01 00:27:03 +03:00
bors
addb753762 Auto merge of #36117 - eddyb:llvm-hoist-meta, r=alexcrichton
llvm: backport "[SimplifyCFG] Hoisting invalidates metadata".

Fixes #36023 by backporting @majnemer's LLVM patch fixing [the LLVM bug](https://llvm.org/bugs/show_bug.cgi?id=29163.) where SimplifyCFG hoisted instructions andkept their metadata (conditional `!nonnull` loads could kill a null check later if hoisted).

r? @alexcrichton
2016-08-29 17:01:09 -07:00
Eduard Burtescu
61a639ec4e llvm: backport "[SimplifyCFG] Hoisting invalidates metadata". 2016-08-29 22:53:18 +03:00
Jorge Aparicio
15d8dfb6a0 build llvm with systemz backend enabled, and link to related libraries
when building rust against system llvm

closes #36077
2016-08-28 13:18:28 -05:00
Vadim Chugunov
cf6461168f Fix debug line info for macro expansions.
Macro expansions produce code tagged with debug locations that are completely different from the surrounding expressions.  This wrecks havoc on debugger's ability the step over source lines.

In order to have a good line stepping behavior in debugger, we overwrite debug locations of macro expansions with that of the outermost expansion site.
2016-08-25 00:40:42 -07:00
Eduard Burtescu
34f856e905 Update LLVM to include 4 backported commits by @majnemer. 2016-08-17 05:37:48 +03:00
Cameron Hart
05045da9fd Improved checking of target's llvm_config
Point llvm @bitshifter branch until PR accepted

Use today's date for LLVM auto clean trigger

Update LLVM submodule to point at rust-lang fork.

Handle case when target is set
2016-08-10 22:24:51 +10:00
Cameron Hart
cbb88faad7 Merge branch 'master' into issue-30961 2016-08-06 15:50:48 +10:00
Eduard Burtescu
63f0c4de67 Support removed LLVM intrinsics by invoking its AutoUpgrade mechanism. 2016-08-03 22:37:57 +03:00
Ariel Ben-Yehuda
3041a97b1a finish type-auditing rustllvm 2016-08-03 15:08:47 +03:00
Ariel Ben-Yehuda
d091ef802f begin auditing the C++ types in RustWrapper 2016-08-03 15:08:47 +03:00
Ariel Ben-Yehuda
696691e3c4 audit LLVM C++ types in ArchiveWrapper and PassWrapper 2016-08-03 15:08:47 +03:00
Ariel Ben-Yehuda
81df89fc2d remove the ExecutionEngine binding
the code has no tests and will just bitrot by itself.

this is a [breaking-change]
2016-08-03 15:08:47 +03:00
Alex Crichton
75bcda4cf1 rustc: Update LLVM to the LLVM 3.9 release branch
The 3.9 release of LLVM isn't out yet, but this moves us onto that branch to
start tracking it.
2016-07-29 10:29:59 +02:00
Jan-Erik Rediger
a36595ed14 Force check of error
The passed error needs to be checked.
Otherwise it will force an abort when it is deconstructed, but a
success value.
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
2c16e24643 Use C type when passing value to LLVM pass
Previously the C type LLVMRelocMode (available as RelocMode in Rust)
was passed as is to the function.
However createTargetMachine expects a Reloc::Model, which is an enum
just one value short.
Additionally, the function was marked as requiring Reloc::Model in the
C code, but RelocMode on the Rust-side.

We now use the correct C type LLVMRelocMode and convert it to an
Optional<Reloc::Model> as expected by the createTargetMachine call the
same the original LLVMCreateTargetMachine function does.
See
c9b262bfbd/lib/Target/TargetMachineC.cpp (L104-L121)

This was found by @eddyb.
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
079db4f971 Use correct error handling type 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
2c92756dde Upgrade llvm 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
09c3f33ec2 Flip LLVM verion check clause 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
f439aeef07 [LLVM-3.9] Use old way of getting next child
This was changed back in
https://github.com/rust-lang/llvm/commit/aacf2fbf
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
1bc0447260 [LLVM-3.9] Maintain backward compatibility in Archiver 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
deafab19be [LLVM-3.9] Increase PIELevel
Previously, we had a PositionIndependentExecutable, now we simply
choose the highest level. This should be equivalent.

🍰
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
9e706f90cb [LLVM-3.9] Configure PIE at the module level instead of compilation unit level
This was deleted here[1] which appears to be replaced by this[2]
which is a new setPIELevel function on the LLVM module itself.

[1]: http://reviews.llvm.org/D19753
[2]: http://reviews.llvm.org/D19671
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
dbb4178f4e [LLVM-3.9] Update return type for Archive::create
Changed in
0b21d88fd3
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
8433f9bb33 [LLVM-3.9] Replace NewArchiveIterator with NewArchiveMember
The new NewArchiveMember is simpler and requires less context,
according to upstream.

This was changed in http://reviews.llvm.org/D21721
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
5b44e10fb7 [LLVM-3.9] Preserve certain functions when internalizing
This makes sure to still use the old way for older LLVM versions.
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
6ed5db8d35 [LLVM-3.9] Specify that we are using the legacy interface
LLVM pass manager infrastructure is currently getting rewritten to be
more flexible, but the rewrite isn't complete yet.
2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
7420874a97 [LLVM-3.9] Rename custom methods to Rust-specific ones 2016-07-29 10:29:44 +02:00
Cameron Hart
ce50bedd8c Pass -DLLVM_RUSTLLVM to compile against rust llvm fork.
If using system llvm don't try use modifications made in the fork.
2016-07-24 19:49:10 +10:00
Cameron Hart
e1efa324ec Add help for target CPUs, features, relocation and code models. 2016-07-11 00:22:13 +10:00
Michael Woerister
051d391f2d Update LLVM. 2016-07-08 10:42:48 -04:00
Jake Goulding
f3d9de4528 Remove unneeded indirection of GET_ARCHIVE 2016-06-09 15:59:27 -04:00
Jake Goulding
4f01329e0e Reflect supporting only LLVM 3.7+ in the LLVM wrappers 2016-06-09 15:59:26 -04:00
Alex Crichton
38e6e5d0a9 rustc: Use C++ personalities on MSVC
Currently the compiler has two relatively critical bugs in the implementation of
MSVC unwinding:

* #33112 - faults like segfaults and illegal instructions will run destructors
           in Rust, meaning we keep running code after a super-fatal exception
           has happened.

* #33116 - When compiling with LTO plus `-Z no-landing-pads` (or `-C
           panic=abort` with the previous commit) LLVM won't remove all `invoke`
           instructions, meaning that some landing pads stick around and
           cleanups may be run due to the previous bug.

These both stem from the flavor of "personality function" that Rust uses for
unwinding on MSVC. On 32-bit this is `_except_handler3` and on 64-bit this is
`__C_specific_handler`, but they both essentially are the "most generic"
personality functions for catching exceptions and running cleanups. That is,
thse two personalities will run cleanups for all exceptions unconditionally, so
when we use them we run cleanups for **all SEH exceptions** (include things like
segfaults).

Note that this also explains why LLVM won't optimize away `invoke` instructions.
These functions can legitimately still unwind (the `nounwind` attribute only
seems to apply to "C++ exception-like unwining"). Also note that the standard
library only *catches* Rust exceptions, not others like segfaults and illegal
instructions.

LLVM has support for another personality, `__CxxFrameHandler3`, which does not
run cleanups for general exceptions, only C++ exceptions thrown by
`_CxxThrowException`. This essentially ideally matches our use case, so this
commit moves us over to using this well-known personality function as well as
exception-throwing function.

This doesn't *seem* to pull in any extra runtime dependencies just yet, but if
it does we can perhaps try to work out how to implement more of it in Rust
rather than relying on MSVCRT runtime bits.

More details about how this is actually implemented can be found in the changes
itself, but this...

Closes #33112
Closes #33116
2016-05-09 17:28:48 -07:00
Fabrice Desré
1d2846dcda Update llvm to 751345228a0ef03fd147394bb5104359b7a808be 2016-04-26 17:03:14 -07:00
Andrea Canciani
c883463e94 Implement feature extraction from TargetMachine
Add the `LLVMRustHasFeature` function to check whether a
`TargetMachine` has a given feature.
2016-04-09 00:39:04 +02:00
Björn Steinbrink
22f4587586 Use weak_odr linkage when reusing definitions across codegen units
When reuing a definition across codegen units, we obviously cannot use
internal linkage, but using external linkage means that we can end up
with multiple conflicting definitions of a single symbol across
multiple crates. Since the definitions should all be equal
semantically, we can use weak_odr linkage to resolve the situation.

Fixes #32518
2016-03-29 16:44:54 +02:00
Björn Steinbrink
95697a8395 Fix removal of function attributes on ARM
We use a 64bit integer to pass the set of attributes that is to be
removed, but the called C function expects a 32bit integer. On most
platforms this doesn't cause any problems other than being unable to
unset some attributes, but on  ARM even the lower 32bit aren't handled
correctly because the 64bit value is passed in different registers, so
the C function actually sees random garbage.

So we need to fix the relevant functions to use 32bit integers instead.
Additionally we need an implementation that actually accepts 64bit
integers because some attributes can only be unset that way.

Fixes #32360
2016-03-26 13:02:54 +01:00
bors
02310fd313 Auto merge of #32362 - bluss:float-fast-math, r=eddyb
Fix floating point fast-math intrinsics

The implementation did not handle the case where both operands were constants, which caused an llvm assertion:

```
rustc: //buildslave//rust-buildbot//slave//nightly-dist-rustc-musl-linux//build//src//llvm//include/llvm/Support/Casting.h:237:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Instruction; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Instruction*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
```
2016-03-19 15:41:42 -07:00