Commit Graph

3150 Commits

Author SHA1 Message Date
bors
23ecebd6bd Auto merge of #43174 - RalfJung:refactor-ty, r=nikomatsakis
Refactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir

I am writing code that needs to call these `ty` methods while mutating MIR -- which is impossible with the current API.

Even with the refactoring the situation is not great: I am cloning the `local_decls` and then passing the clone to the `ty` methods. I have to clone because `Mir::basic_blocks_mut` borrows the entire `Mir` including the `local_decls`. But even that is better than not being able to get these types at all...

Cc @nikomatsakis
2017-07-14 23:29:51 +00:00
Ralf Jung
66fce33ecb overload the mir ty methods to make them more ergonomic to use 2017-07-12 12:59:05 -07:00
bors
8bba5ad309 Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakis
incr.comp.: Don't include span information in the ICH of type definitions

This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088).

r? @nikomatsakis
2017-07-12 08:45:39 +00:00
Ralf Jung
62b2e5446d Refactor: {Lvalue,Rvalue,Operand}::ty only need the locals' types, not the full &Mir 2017-07-11 16:38:16 -07:00
Tobias Schottdorf
687ee7fee4 Downgrade ProjectionTy's TraitRef to its substs
Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.
2017-07-11 10:33:09 -04:00
bors
a1f180bde3 Auto merge of #43147 - oyvindln:deflate_fix, r=alexcrichton
Use similar compression settings as before updating to use flate2

Fixes #42879

(My first PR to rust-lang yay)

This changes the compression settings back to how they were before the change to use the flate2 crate rather than the in-tree flate library. The specific changes are to use the `Fast` compression level (which should be equivialent to what was used before), and use a raw deflate stream rather than wrapping the stream in a zlib wrapper. The [zlib](https://tools.ietf.org/html/rfc1950) wrapper adds an extra 2 bytes of header data, and 4 bytes for a checksum at the end. The change to use a faster compression level did give some compile speedups in the past (see #37298). Having to calculate a checksum also added a small overhead, which didn't exist before the change to flate2.

r? @alexcrichton
2017-07-11 07:42:13 +00:00
oyvindln
37f56a2ab1 Use similar compression settings as before updating to use flate2
Fixes #42879
2017-07-10 17:54:50 +02:00
Michael Woerister
6d049fb5bb incr.comp.: Cache DepNodes with corresponding query results. 2017-07-10 12:21:39 +02:00
Michael Woerister
ca0a40396c incr.comp.: Improve debug output for work products. 2017-07-10 12:20:56 +02:00
bors
13157c4ebc Auto merge of #42809 - seanmonstar:stable-associated-consts, r=nikomatsakis
remove associated_consts feature gate

Currently struggling to run tests locally (something about jemalloc target missing).

cc #29646
2017-07-07 18:42:14 +00:00
Michael Woerister
bca857021e incr.comp.: Don't include span information in the ICH of type definitions. 2017-07-07 14:23:38 +02:00
Sean McArthur
74b2d69358 remove associated_consts feature gate 2017-07-06 11:52:25 -07:00
Alex Crichton
5dbd97de3d rustc: Implement stack probes for x86
This commit implements stack probes on x86/x86_64 using the freshly landed
support upstream in LLVM. The purpose of stack probes here are to guarantee a
segfault on stack overflow rather than having a chance of running over the guard
page already present on all threads by accident.

At this time there's no support for any other architecture because LLVM itself
does not have support for other architectures.
2017-07-06 08:58:19 -07:00
bors
8cab2c73d4 Auto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakis
Switch to rust-lang-nursery/compiler-builtins

This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-06 02:34:29 +00:00
Alex Crichton
695dee063b rustc: Implement the #[global_allocator] attribute
This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/197

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389
2017-07-05 14:37:01 -07:00
Alex Crichton
7e6c9f3635 Switch to rust-lang-nursery/compiler-builtins
This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-05 07:08:36 -07:00
est31
da887074fc Output line column info when panicking 2017-07-02 13:53:29 +02:00
Stepan Koltsov
b62bdaafe0 When writing LLVM IR output demangled fn name in comments
`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15
2017-07-01 03:16:43 +03:00
Masaki Hara
23d1521684
Add unsized tuple coercions. 2017-06-29 21:23:33 +09:00
bors
c28cbfb127 Auto merge of #42797 - arielb1:ex-falso-ice, r=nikomatsakis
avoid translating roots with predicates that do not hold

Finally I got around to doing this.

Fixes #37725.

r? @nikomatsakis
2017-06-28 23:58:11 +00:00
Ariel Ben-Yehuda
a6ca302097 add comments 2017-06-28 23:50:24 +03:00
bors
c16930762a Auto merge of #42745 - sfackler:1.19-stabilization, r=alexcrichton
1.19 stabilization

r? @alexcrichton
2017-06-28 11:55:37 +00:00
Eduard-Mihai Burtescu
33ecf72e8e rustc: move the PolyFnSig out of TyFnDef. 2017-06-27 16:39:52 +03:00
Eduard-Mihai Burtescu
8e53a03d15 rustc: rename closure_type to fn_sig. 2017-06-27 16:32:48 +03:00
Steven Fackler
14c2f99f80 Stabilize Command::envs
Closes #38526
2017-06-24 19:19:26 -07:00
bors
bc9822af2e Auto merge of #42784 - tlively:wasm-bot, r=alexcrichton
Make wasm32 buildbot test LLVM backend

This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.
2017-06-24 22:34:08 +00:00
bors
c9bb93576d Auto merge of #42864 - slo1:attempt, r=Mark-Simulacrum
Saves created temp directory if save-temps option is used.

Should fix #38068.
2017-06-24 14:43:01 +00:00
slo
a5c29cbf38 Saves created temp directory if save-temps option is used. 2017-06-23 13:20:23 -04:00
Mark Simulacrum
f3aebb0a83 Rollup merge of #42821 - michaelwoerister:incr-debug-output-on-stderr, r=alexcrichton
Print -Zincremental-info to stderr instead of stdout.

Fixes #42583.

The [cargo-incremental](https://github.com/nikomatsakis/cargo-incremental) tool probably does not need to be updated. It already merges stdout and stderr before parsing the compiler's output.

r? @alexcrichton
2017-06-23 06:02:10 -06:00
kennytm
4711982314
Removed as many "```ignore" as possible.
Replaced by adding extra imports, adding hidden code (`# ...`), modifying
examples to be runnable (sorry Homura), specifying non-Rust code, and
converting to should_panic, no_run, or compile_fail.

Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-23 15:31:53 +08:00
Thomas Lively
16da303209 Add target option for linker environment variables
This is used in wasm32-experimental-emscripten to ensure that emscripten
links against the libc bitcode files produced by the wasm LLVM backend,
instead of using fastcomp.
2017-06-22 18:34:56 -07:00
Michael Woerister
12b11d8346 Print -Zincremental-info to stderr instead of stdout. 2017-06-22 10:27:51 +02:00
bors
03c8b92dc1 Auto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn
debuginfo: Work around crash-bug in MSDIA library

Fixes https://github.com/rust-lang/rust/issues/40477 (which also contains a description of the issue being fixed).

r? @vadimcn
2017-06-22 08:10:27 +00:00
Michael Woerister
8261413591 debuginfo: Work around crash-bug in MSDIA library 2017-06-22 09:49:44 +02:00
bors
80271e8edf Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister
Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.
2017-06-22 00:32:42 +00:00
bors
6de26f42de Auto merge of #42771 - arielb1:no-inline-unwind, r=nagisa
mark calls in the unwind path as !noinline

The unwind path is always cold, so that should not have bad performance
implications.  This avoids catastrophic exponential inlining, and also
decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so`
increased by 0.5% for some reason).

Fixes #41696.

r? @nagisa
2017-06-21 21:29:45 +00:00
Alex Crichton
201f06988f Integrate jobserver support to parallel codegen
This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.
2017-06-21 07:16:43 -07:00
Ariel Ben-Yehuda
3ac976861d avoid translating roots with predicates that do not hold
Fixes #37725.
2017-06-21 16:16:19 +03:00
Ariel Ben-Yehuda
0b93798959 mark calls in the unwind path as !noinline
The unwind path is always cold, so that should not have bad performance
implications.  This avoids catastrophic exponential inlining, and also
decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so`
increased by 0.5% for some reason).

Fixes #41696.
2017-06-20 22:02:49 +03:00
Alex Crichton
a4024c58e1 Remove the in-tree flate crate
A long time coming this commit removes the `flate` crate in favor of the
`flate2` crate on crates.io. The functionality in `flate2` originally flowered
out of `flate` itself and is additionally the namesake for the crate. This will
leave a gap in the naming (there's not `flate` crate), which will likely cause a
particle collapse of some form somewhere.
2017-06-20 07:11:29 -07:00
Alex Crichton
be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
bors
04145943a2 Auto merge of #39409 - pnkfelix:mir-borrowck2, r=nikomatsakis
MIR EndRegion Statements (was MIR dataflow for Borrows)

This PR adds an `EndRegion` statement to MIR (where the `EndRegion` statement is what terminates a borrow).

An earlier version of the PR implemented a dataflow analysis on borrow expressions, but I am now factoring that into a follow-up PR so that reviewing this one is easier. (And also because there are some revisions I want to make to that dataflow code, but I want this PR to get out of WIP status...)

This is a baby step towards MIR borrowck. I just want to get the review process going while I independently work on the remaining steps.
2017-06-19 13:01:27 +00:00
Ariel Ben-Yehuda
09219d6a49 collector: apply param substs to closures cast to fn items
Fixes #42718.
2017-06-18 18:57:39 +03:00
Corey Farwell
6062bf7aca Rollup merge of #42705 - est31:master, r=alexcrichton
Introduce tidy lint to check for inconsistent tracking issues

This PR
* Refactors the collect_lib_features function to work in a
      non-checking mode (no bad pointer needed, and list of
      lang features).
* Introduces checking whether unstable/stable tags for a
      given feature have inconsistent tracking issues, as in,
      multiple tracking issues per feature.
* Fixes such inconsistencies throughout the codebase.
2017-06-16 23:10:50 -07:00
bors
3cb803460b Auto merge of #42598 - cramertj:track-more-metadata, r=nikomatsakis
Track more crate metadata

Part of https://github.com/rust-lang/rust/issues/41417
r? @nikomatsakis
2017-06-16 21:42:17 +00:00
est31
c6afde6c46 Introduce tidy lint to check for inconsistent tracking issues
This commit
    * Refactors the collect_lib_features function to work in a
      non-checking mode (no bad pointer needed, and list of
      lang features).
    * Introduces checking whether unstable/stable tags for a
      given feature have inconsistent tracking issues.
    * Fixes such inconsistencies throughout the codebase.
2017-06-16 20:40:40 +02:00
Taylor Cramer
c98ca953b0 Switch CrateNum queries to DefId 2017-06-14 22:49:07 -07:00
bors
dfa7e21e4e Auto merge of #42433 - marco-c:profiling, r=alexcrichton
Build instruction profiler runtime as part of compiler-rt

r? @alexcrichton

This is #38608 with some fixes.

Still missing:
- [x] testing with profiler enabled on some builders (on which ones? Should I add the option to some of the already existing configurations, or create a new configuration?);
- [x] enabling distribution (on which builders?);
- [x] documentation.
2017-06-14 08:46:14 +00:00
Taylor Cramer
b0f05d4bc5 On-demandify is_allocator and is_panic_runtime 2017-06-14 00:13:35 -07:00
Niko Matsakis
3f99118871 kill various tasks we no longer need and remove outdated README text
In the case of `TransCrateItem`, I had to tweak the tests a bit, but
it's a concept that doesn't work well under new system.
2017-06-12 16:00:31 -04:00