Commit Graph

141 Commits

Author SHA1 Message Date
Vadim Petrochenkov 9ac79e4934 Update rls to pull rustfmt with libsyntax changes 2017-07-10 00:20:25 +03: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
bors 1685c92986 Auto merge of #42727 - alexcrichton:allocators-new, r=eddyb
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/1974

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-06 00:16:16 +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 fd95db25b3 Merge remote-tracking branch 'origin/master' into proc_macro_api 2017-07-05 08:42:13 -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 3b91f9406c Update cargo
... to get https://github.com/rust-lang/cargo/pull/4244 and
https://github.com/rust-lang/cargo/pull/4246
2017-07-02 16:42:13 +02:00
bors d41b791c1a Auto merge of #42971 - stepancheg:ir-demangle, r=nagisa
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 05:52:08 +00: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
Nick Cameron 3dad1977a5 Update RLS submodule 2017-06-28 06:40:23 +12:00
Mark Simulacrum 38b468832f Update Cargo 2017-06-26 10:30:36 -06:00
Jeffrey Seyfried e42836b208 Implement `quote!` and other `proc_macro` API. 2017-06-26 02:06:26 +00: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
Corey Farwell 80e14a0fe3 Rollup merge of #42766 - nrc:versions, r=nagisa
Update rls-data version

And update the RLS submod
2017-06-21 10:40:17 -04: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
Alex Crichton 5c3d0e6de3 Switch to the crates.io `getopts` crate
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based
`getopts` crate. The main difference here is with a new builder-style API, but
otherwise everything else remains relatively standard.
2017-06-20 12:43:12 -07:00
bors 753fee4ab6 Auto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrum
Bump to 1.20.0 and update stage0 compiler

Betas are hot off the bots, let's get them while they're fresh.
2017-06-20 07:22:38 +00:00
Nick Cameron 7a18a77e1b Update rls-data dep 2017-06-20 18:55:14 +12:00
Alex Crichton be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
Alex Crichton 5bc4031e63 Update `wincolor` dep for Cargo
Closes rust-lang/cargo#4189
2017-06-19 10:44:12 -07:00
bors 10d7cb44c9 Auto merge of #42676 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update cargo/rls submodules and dependencies

Brings in a few regression fixes on the Cargo side, updates the rls to work
with the newer Cargo, and also updates other crates.io dependencies to pull in
various bug fixes and such.
2017-06-18 21:10:33 +00:00
Mark Simulacrum c982529327 Rollup merge of #42720 - murarth:deprecated-collections, r=alexcrichton
Reintroduce deprecated `collections` crate
2017-06-18 10:34:10 -06:00
bors 28cc0c5a7b Auto merge of #42593 - ibabushkin:on-demand-external-source, r=eddyb
Implement lazy loading of external crates' sources. Fixes #38875

Fixes #38875. This is a follow-up to #42507. When a (now correctly translated) span from an external crate is referenced in a error, warning or info message, we still don't have the source code being referenced.
Since stuffing the source in the serialized metadata of an rlib is extremely wasteful, the following scheme has been implemented:

* File maps now contain a source hash that gets serialized as well.
* When a span is rendered in a message, the source hash in the corresponding file map(s) is used to try and load the source from the corresponding file on disk. If the file is not found or the hashes don't match, the failed attempt is recorded (and not retried).
* The machinery fetching source lines from file maps is augmented to use the lazily loaded external source as a secondary fallback for file maps belonging to external crates.

This required a small change to the expected stderr of one UI test (it now renders a span, where previously was none).

Further work can be done based on this - some of the machinery previously used to hide external spans is possibly obsolete and the hashing code can be reused in different places as well.

r? @eddyb
2017-06-18 10:41:05 +00:00
Murarth 6484258f17 Reintroduce deprecated `collections` crate 2017-06-17 13:18:18 -07:00
Alex Crichton 1cede109d8 Update cargo/rls submodules and dependencies
Brings in a few regression fixes on the Cargo side, updates the rls to work
with the newer Cargo, and also updates other crates.io dependencies to pull in
various bug fixes and such.
2017-06-17 12:00:49 -07:00
bors b40be00a0c Auto merge of #42612 - est31:master, r=nagisa
Autogenerate stubs and SUMMARY.md in the unstable book

Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion.

The PR contains three commits, separated in order to make review easy:

* The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library
* The second and main commit introduces autogeneration of SUMMARY.md and feature stub files
* The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched

Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout):

1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book
2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs
3. choose a file to edit, then `git add` it and `git commit`
4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f`

Or they can do this:

1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122
2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs
3. revert the change in 1
3. document one of the chosen unstable features

The changes done by this PR also allow for further development:

* tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR
* we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes.

The old way to simply click through the documentation after it has been uploaded to rust-lang.org works as well.

r? @nagisa

Fixes #42454
2017-06-16 14:41:15 +00:00
bors 258ae6dd9b Auto merge of #42648 - murarth:merge-alloc-collections, r=alexcrichton
Merge crate `collections` into `alloc`

This is a necessary step in order to merge #42565
2017-06-15 12:37:54 +00: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
Murarth eadda7665e Merge crate `collections` into `alloc` 2017-06-13 23:37:34 -07:00
est31 c2d59067fb Autogenerate stubs and the summary of the unstable book 2017-06-14 04:59:27 +02:00
Nick Cameron 34bd80a782 Fix rebasing error 2017-06-12 14:29:59 +12:00
Nick Cameron 0058fdd110 Update rls-data 2017-06-12 14:14:23 +12:00
Inokentiy Babushkin dd8f7cd126
Moved FileMap construction to it's own constructor.
The rationale is that BOM stripping is needed for lazy source loading
for external crates, and duplication can be avoided by moving the
corresponding functionality to libsyntax_pos.
2017-06-10 16:09:51 +02:00
Corey Farwell 13ae42fb20 Rollup merge of #42512 - Keruspe:master, r=alexcrichton
update git2

Fixes build with libressl
2017-06-07 21:58:46 -04:00
Marc-Antoine Perennou 95bc0d6c79 update git2
Fixes build with libressl

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-06-07 21:42:31 +02:00
Alex Crichton 453080f13e Update Cargo
Brings in some perf improvements!
2017-06-07 07:57:59 -07:00
Marco Castelluccio ecba8d6a23 Merge branch 'profiling' of github.com:whitequark/rust into profiling 2017-06-04 15:54:39 +01:00
Mark Simulacrum 5775c9ec5f Rollup merge of #42343 - cuviper:install-executables, r=alexcrichton
Update rust-installer for Windows executable mode

It now marks a few whitelisted extensions as executable in the tarball,
so Windows packages can be extracted on other platforms and directly
execute install.sh.

It also includes a fix for the chmod on bulk dirs, so now the html docs
won't be marked executable en masse.

Fixes #42121
r? @alexcrichton
2017-06-02 09:10:45 -06:00
Brian Anderson da100fe0bb Support VS 2017
Fixes #38584
2017-06-01 20:41:38 +00:00
Josh Stone 0fba1f753d Update rust-installer for Windows executable mode
It now marks a few whitelisted extensions as executable in the tarball,
so Windows packages can be extracted on other platforms and directly
execute install.sh.

It also includes a fix for the chmod on bulk dirs, so now the html docs
won't be marked executable en masse.

Fixes #42121
r? @alexcrichton
2017-05-31 17:21:00 -07:00
Alex Crichton 3146d9f3a7 Updated locked version of libgit2
This should include a fix for rust-lang/cargo#4091 with an updated version of
libgit2.

Closes rust-lang/cargo#4091
2017-05-28 10:27:42 -07:00
Alex Crichton e0f11b4dde Update Cargo submodule
Contains a fix for rust-lang/cargo#4081
2017-05-24 12:59:58 -07:00
Tatsuyuki Ishi 0e79b9790a Unify all stage2 tools into a workspace
This avoids double compiled Cargo. Hopefully this would speed up (extended) compilation for ~10m.

Notes: when updating Cargo submodule, the replacement version may also need to be updated.
2017-05-18 00:30:54 +09:00
bors b28cf7564a Auto merge of #41853 - Keruspe:install, r=alexcrichton
rustbuild: add support for --bindir and --sysconfdir

This depends on https://github.com/rust-lang/rust-installer/pull/59 and we'll need to udpate the rust-installer submodule once it gets merged for it to work

Fixes #41644
2017-05-16 17:18:23 +00:00
Marc-Antoine Perennou 08cc29e762 update lzma-sys to 0.1.4
fixes build when DESTDIR is set

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-16 16:28:36 +02:00
bors fa78d5bb87 Auto merge of #41565 - rkruppe:llvm-sys, r=eddyb
Make only rustc_trans depend on rustc_llvm

With these changes, only rustc_trans depends directly on rustc_llvm (and no crate gained a new dependency on trans). This means changing LLVM doesn't rebuild librustc or rustc_metadata, only rustc_trans, rustc_driver and the rustc executable
Also, rustc_driver technically doesn't know about LLVM any more (of course, it still handles a ton of options that conceptually refer to LLVM, but it delegates their implementation to trans).

What I *didn't* implement was merging most or all of rustc_llvm into rustc_trans. I ran into a nasty bug, which was probably just a silly typo somewhere but I probably won't have the time to figure it out in the next week or two. I opened #41699 for that step.

Fixes #41473
2017-05-16 05:41:11 +00:00
Robin Kruppe e3f6e68d63 Remove (direct) rustc_llvm dependency from rustc_driver
This does not actually improve build times, since it still depends
on rustc_trans, but is better layering and fits the multi-backend
future slightly better.
2017-05-15 11:13:32 +02:00
Robin Kruppe 8e4f315116 Remove rustc_llvm dependency from librustc
Consequently, session creation can no longer initialize LLVM.
The few places that use the compiler without going through
rustc_driver/CompilerCalls thus need to be careful to manually
initialize LLVM (via rustc_trans!) immediately after session
creation.

This means librustc is not rebuilt when LLVM changes.
2017-05-15 11:13:30 +02:00
Josh Stone 020c5ecca7 Update to the oxidized rust-installer 2017-05-14 21:06:23 -07:00
Robin Kruppe 1a24a591dd Remove rustc_llvm dependency from rustc_metadata
Move the code for loading metadata from rlibs and dylibs from
rustc_metadata into rustc_trans, and introduce a trait to avoid
introducing a direct dependency on rustc_trans.

This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-14 20:30:22 +02:00