Commit Graph

1475 Commits

Author SHA1 Message Date
gentoo90
10977bcf6c Fix 'invalid literal for int()' exception with unicode in pretty-printers
str() can't handle unicode strings
2017-05-30 23:42:35 +03:00
gentoo90
167e4b09d1 Fix 'invalid literal for int()' exception in pretty-printers
Some pointers values include additional info,
so they can't be parsed with int().
2017-05-30 11:17:05 +03:00
Edward Yang
f3b29d3f01 Fix formatting issues in Distribution.xml 2017-05-29 21:55:35 -05:00
Edward Yang
7c362732dc Add RLS to .pkg installer 2017-05-29 21:50:23 -05:00
Edward Yang
eeebfd667b Add RLS to .exe and .msi installers 2017-05-29 21:31:33 -05:00
gentoo90
ac33d2cbfb Fix GDB pretty-printer for tuples
Names of children should not be the same,
because GDB uses them to distinguish the children.
2017-05-28 12:08:40 +03:00
Wesley Wiser
173f6930ba Rewrite make-win-dist.py in Rust
Fixes #41568
2017-05-14 21:24:29 -04:00
Michael Wu
cc4efd1370 Add support for Hexagon v60 HVX intrinsics 2017-05-07 15:07:36 -04:00
Corey Farwell
ed1b78c16b Move unicode Python script into libstd_unicode crate.
The only place this Python script is used is inside the libstd_unicode
crate, so lets move it there.
2017-05-04 22:37:55 -04:00
bors
ad1461efb9 Auto merge of #41575 - alexcrichton:android-qemu-server, r=TimNN
travis: Parallelize tests on Android

Currently our slowest test suite on android, run-pass, takes over 5 times longer
than the x86_64 component (~400 -> ~2200s). Typically QEMU emulation does indeed
add overhead, but not 5x for this kind of workload. One of the slowest parts of
the Android process is that *compilation* happens serially. Tests themselves
need to run single-threaded on the emulator (due to how the test harness works)
and this forces the compiles themselves to be single threaded.

Now Travis gives us more than one core per machine, so it'd be much better if we
could take advantage of them! The emulator itself is still fundamentally
single-threaded, but we should see a nice speedup by sending binaries for it to
run much more quickly.

It turns out that we've already got all the toos to do this in-tree. The
qemu-test-{server,client} that are in use for the ARM Linux testing are a
perfect match for the Android emulator. This commit migrates the custom adb
management code in compiletest/rustbuild to the same qemu-test-{server,client}
implementation that ARM Linux uses.

This allows us to lift the parallelism restriction on the compiletest test
suites, namely run-pass. Consequently although we'll still basically run the
tests themselves in single threaded mode we'll be able to compile all of them in
parallel, keeping the pipeline much more full hopefully and using more cores for
the work at hand. Additionally the architecture here should be a bit speedier as
it should have less overhead than adb which is a whole new process on both the
host and the emulator!

Locally on an 8 core machine I've seen the run-pass test suite speed up from
taking nearly an hour to only taking 5 minutes. I don't think we'll see quite a
drastic speedup on Travis but I'm hoping this change can place the Android tests
well below 2 hours instead of just above 2 hours.

Because the client/server here are now repurposed for more than just QEMU,
they've been renamed to `remote-test-{server,client}`.

Note that this PR does not currently modify how debuginfo tests are executed on
Android. While parallelizable it wouldn't be quite as easy, so that's left to
another day. Thankfull that test suite is much smaller than the run-pass test
suite.
2017-04-28 16:10:08 +00:00
Alex Crichton
7bc2cbf5db travis: Parallelize tests on Android
Currently our slowest test suite on android, run-pass, takes over 5 times longer
than the x86_64 component (~400 -> ~2200s). Typically QEMU emulation does indeed
add overhead, but not 5x for this kind of workload. One of the slowest parts of
the Android process is that *compilation* happens serially. Tests themselves
need to run single-threaded on the emulator (due to how the test harness works)
and this forces the compiles themselves to be single threaded.

Now Travis gives us more than one core per machine, so it'd be much better if we
could take advantage of them! The emulator itself is still fundamentally
single-threaded, but we should see a nice speedup by sending binaries for it to
run much more quickly.

It turns out that we've already got all the tools to do this in-tree. The
qemu-test-{server,client} that are in use for the ARM Linux testing are a
perfect match for the Android emulator. This commit migrates the custom adb
management code in compiletest/rustbuild to the same qemu-test-{server,client}
implementation that ARM Linux uses.

This allows us to lift the parallelism restriction on the compiletest test
suites, namely run-pass. Consequently although we'll still basically run the
tests themselves in single threaded mode we'll be able to compile all of them in
parallel, keeping the pipeline much more full and using more cores for the work
at hand. Additionally the architecture here should be a bit speedier as it
should have less overhead than adb which is a whole new process on both the host
and the emulator!

Locally on an 8 core machine I've seen the run-pass test suite speed up from
taking nearly an hour to only taking 6 minutes. I don't think we'll see quite a
drastic speedup on Travis but I'm hoping this change can place the Android tests
well below 2 hours instead of just above 2 hours.

Because the client/server here are now repurposed for more than just QEMU,
they've been renamed to `remote-test-{server,client}`.

Note that this PR does not currently modify how debuginfo tests are executed on
Android. While parallelizable it wouldn't be quite as easy, so that's left to
another day. Thankfully that test suite is much smaller than the run-pass test
suite.

As a final fix I discovered that the ARM and Android test suites were actually
running all library unit tests (e.g. stdtest, coretest, etc) twice. I've
corrected that to only run tests once which should also give a nice boost in
overall cycle time here.
2017-04-27 20:20:13 -07:00
Alex Crichton
929124fa3c windows: Copy libwinpthread-1.dll into libdir bin
Recently we switched from the win32 MinGW toolchain to the pthreads-based
toolchain. We ship `gcc.exe` from this toolchain with the `rust-mingw` package
in the standard distribution but the pthreads version of `gcc.exe` depends on
`libwinpthread-1.dll`. While we're shipping this DLL for the compiler to depend
on we're not shipping it for gcc. As a workaround just copy the dll to gcc.exe
location and don't attempt to share for now.

cc https://github.com/rust-lang/rust/issues/31840#issuecomment-297478538
2017-04-26 18:35:01 -07:00
Andrew Gaspar
70e673952e Adds rust-windbg.cmd script 2017-04-24 16:26:00 -07:00
Nicolas Bigaouette
61b7ebe7d3 Rename environment variable GDB_CMD to RUST_GDB to prevent ambiguity 2017-04-20 11:20:33 -04:00
Nicolas Bigaouette
82ed7830ad Use an (over-writable) environment variable for the gdb command
Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
2017-04-18 14:00:08 -04:00
Diggory Blake
1528cbefdb Remove non-breaking spaces 2017-04-17 17:49:35 +01:00
bors
1a9b382168 Auto merge of #40805 - vadimcn:msys-mingw, r=alexcrichton
[Windows] Enable building rustc with "pthreads" flavor of mingw.

Tested on mingw-w64 packaged with msys2.

r? @alexcrichton

cc #40123
2017-04-06 03:42:31 +00:00
Kang Seonghoon
44bcd261a7 Reduce a table used for Debug impl of str.
This commit shrinks the size of the aforementioned table from
2,102 bytes to 1,197 bytes. This is achieved by an observation that
most u16 entries are common in its upper byte. Specifically:

- SINGLETONS now uses two tables, one for (upper byte, lower count)
  and another for a series of lower bytes. For each upper byte given
  number of lower bytes are read and compared.

- NORMAL now uses a variable length format for the count of "true"
  codepoints and "false" codepoints (one byte with MSB unset, or
  two big-endian bytes with the first MSB set).

The code size and relative performance roughly remains same as this
commit tries to optimize for both. The new table and algorithm has
been verified for the equivalence to older ones.
2017-04-05 09:13:19 -07:00
Vadim Chugunov
ad3f6e056c Include libpthread into mingw package. 2017-03-30 16:31:46 -07:00
Andrew Gaspar
a8b7b28bab Vec, LinkedList, VecDeque, String, and Option NatVis visualizations 2017-02-15 01:51:19 -08:00
bors
61b93bd811 Auto merge of #38561 - nagisa:rdrandseed, r=alexcrichton
Add intrinsics & target features for rd{rand,seed}

One question is whether or not we want to map feature name `rdrnd` to `rdrand` instead.

EDIT: as for use case, I would like to port my rdrand crate from inline assembly to these intrinsics.
2017-02-14 01:26:10 +00:00
Alex Crichton
ffd3070cc9 Clean our src/etc of old files
Some of these have long since expired, some are no longer in use now that we've
jettisoned the makefiles, but none of them should be needed any more.
2017-02-06 08:43:37 -08:00
Alex Crichton
f3dfcae202 rustbuild: Start building --enable-extended
This commit adds a new flag to the configure script,
`--enable-extended`, which is intended for specifying a desire to
compile the full suite of Rust tools such as Cargo, the RLS, etc. This
is also an indication that the build system should create combined
installers such as the pkg/exe/msi artifacts.

Currently the `--enable-extended` flag just indicates that combined
installers should be built, and Cargo is itself not compiled just yet
but rather only downloaded from its location. The intention here is to
quickly get to feature parity with the current release process and then
we can start improving it afterwards.

All new files in this PR inside `src/etc/installer` are copied from the
rust-packaging repository.
2017-01-24 14:48:03 -08:00
bors
089682611f Auto merge of #38781 - SimonSapin:unishrink, r=alexcrichton
Reduce the size of static data in std_unicode::tables

`BoolTrie` works well for sets of code points spread out through most of Unicode’s range, but is uses a lot of space for sets with few, mostly low, code points.

This switches a few of its instances to a similar but simpler trie data structure.

CC @raphlinus, who wrote the original `BoolTrie`.

## Before

`size_of::<BoolTrie>()` is 1552, which is added to `table.r3.len() * 8 + t.r5.len() + t.r6.len() * 8`:

* `Cc_table`: 1632
* `White_Space_table`: 1656
* `Pattern_White_Space_table`: 1640
* Total: 4928 bytes

## After

`size_of::<SmallBoolTrie>()` is 32, which is added to `t.r1.len() + t.r2.len() * 8`:

* `Cc_table`: 51
* `White_Space_table`: 273
* `Pattern_White_Space_table`: 193
* Total: 517 bytes

## Difference

Every Rust program with `std` statically linked should be about 4 KB smaller.
2017-01-07 21:28:47 +00:00
Simon Sapin
3b208d2dac Reduce the size of static data in std_unicode::tables.
`BoolTrie` works well for sets of code points spread out through
most of Unicode’s range, but is uses a lot of space for sets
with few, mostly low, code points.

This switches a few of its instances to a similar but simpler trie
data structure.

 ## Before

`size_of::<BoolTrie>()` is 1552, which is added to
`table.r3.len() * 8 + t.r5.len() + t.r6.len() * 8`:

* `Cc_table`: 1632
* `White_Space_table`: 1656
* `Pattern_White_Space_table`: 1640
* Total: 4928 bytes

 ## After

`size_of::<SmallBoolTrie>()` is 32, which is added to
`t.r1.len() + t.r2.len() * 8`:

* `Cc_table`: 51
* `White_Space_table`: 273
* `Pattern_White_Space_table`: 193
* Total: 517 bytes

 ## Difference

Every Rust program with `std` statically linked should be about 4 KB smaller.
2017-01-03 08:28:58 +01:00
Simon Sapin
90c7c05ecb Remove some dead Python code.
It was used to measure before/after size in cfaf66c94e.
2017-01-02 12:55:41 +01:00
Philip Craig
1765a3fd30 Add pretty printing of unions in debuggers
Fixes #37479
2017-01-01 19:34:06 +10:00
Jorge Aparicio
18d49288d5 PTX support
- `--emit=asm --target=nvptx64-nvidia-cuda` can be used to turn a crate
  into a PTX module (a `.s` file).

- intrinsics like `__syncthreads` and `blockIdx.x` are exposed as
  `"platform-intrinsics"`.

- "cabi" has been implemented for the nvptx and nvptx64 architectures.
  i.e. `extern "C"` works.

- a new ABI, `"ptx-kernel"`. That can be used to generate "global"
  functions. Example: `extern "ptx-kernel" fn kernel() { .. }`. All
  other functions are "device" functions.
2016-12-26 21:06:23 -05:00
Simonas Kazlauskas
b2cf6df875 Add intrinsics & target features for rd{rand,seed} 2016-12-22 23:53:30 +02:00
Eduard Burtescu
9aaf26e7aa rustc: rework stability to be on-demand for type-directed lookup. 2016-11-28 04:18:11 +02:00
Tobias Bucher
d0bb7e1946 Fix fmt::Debug for strings, e.g. for Chinese characters
The problem occured due to lines like

```
3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;;
4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;;
```

in `UnicodeData.txt`, which the script previously interpreted as two
characters, although it represents the whole range.

Fixes #34318.
2016-11-18 14:45:59 +01:00
Josh Stone
86f02f6020 Add libproc_macro from local rust to stage0
This library is now required to run rustc 1.14.0.
2016-10-19 00:12:42 -07:00
Niels Sascha Reedijk
01fecb9f8f Haiku: add support for building on Haiku
* Hand rebased from Niels original work on 1.9.0
2016-09-25 11:15:18 -05:00
Eitan Adler
1a4a723dda remove useless semicolon from python 2016-09-17 23:10:12 -07:00
Eitan Adler
22c66c4b38 modern style classes 2016-09-17 23:09:21 -07:00
Eitan Adler
733fe1d25c make functions static where possible 2016-09-17 23:08:31 -07:00
Eitan Adler
3545785041 Remove unused code 2016-09-17 23:07:11 -07:00
Eitan Adler
1a67298f20 prefer tuple to array 2016-09-17 23:06:45 -07:00
Eitan Adler
266ef889e3 pep8 prefers triple quoted with double quotes 2016-09-17 23:05:20 -07:00
Eitan Adler
8de97dddfd simplify python code 2016-09-17 22:52:00 -07:00
bors
824000aee3 Auto merge of #35585 - Kha:gdb-qualified, r=michaelwoerister
gdb: Fix pretty-printing special-cased Rust types

gdb trunk now reports fully qualified type names, just like lldb. Move lldb code for extracting unqualified names to shared file.

For current releases of gdb, `extract_type_name` should just be a no-op.

Fixes #35155
2016-08-31 05:51:58 -07:00
bors
308824acec Auto merge of #35748 - michaelwoerister:fix-rust-gdb-py-version-check, r=brson
Make version check in gdb_rust_pretty_printing.py more compatible.

Some versions of Python don't support the `major` field on the object returned by `sys.version_info`.

Fixes #35724

r? @brson
2016-08-23 22:52:29 -07:00
Terry Sun
1d78f9eb89 Add sublime-rust to CONFIGS.md. 2016-08-22 01:24:01 -04:00
Michael Woerister
6aca068aba Make version check in gdb_rust_pretty_printing.py more compatible.
Some versions of Python don't support the `major` field on the
object returned by `sys.version_info`.
2016-08-17 09:55:27 -04:00
Sebastian Ullrich
471407205b gdb: Fix pretty-printing special-cased Rust types
gdb trunk now reports fully qualified type names, just like lldb. Move
lldb code for extracting unqualified names to shared file.
2016-08-10 22:35:58 -04:00
bors
28ce3e8a55 Auto merge of #35163 - sanxiyn:rollup, r=sanxiyn
Rollup of 8 pull requests

- Successful merges: #34802, #35033, #35085, #35114, #35134, #35140, #35141, #35157
- Failed merges:
2016-08-01 08:57:32 -07:00
bors
2c1612c62a Auto merge of #34743 - badboy:llvm-upgrade, r=eddyb
LLVM upgrade

As discussed in https://internals.rust-lang.org/t/need-help-with-emscripten-port/3154/46 I'm trying to update the used LLVM checkout in Rust.

I basically took @shepmaster's code and applied it on top (though I did the commits manually, the [original commits have better descriptions](https://github.com/rust-lang/rust/compare/master...avr-rust:avr-support).

With these changes I was able to build rustc. `make check` throws one last error on `run-pass/issue-28950.rs`. Output: https://gist.github.com/badboy/bcdd3bbde260860b6159aa49070a9052

I took the metadata changes as is and they seem to work, though it now uses the module in another step. I'm not sure if this is the best and correct way.

Things to do:

* [x] ~~Make `run-pass/issue-28950.rs` pass~~ unrelated
* [x] Find out how the `PositionIndependentExecutable` setting is now used
* [x] Is the `llvm::legacy` still the right way to do these things?

cc @brson @alexcrichton
2016-08-01 04:47:48 -07:00
Seo Sanghyeon
d7a04403ae Remove CMake workaround 2016-08-01 18:03:22 +09:00
Brendan Cully
e9d2c9654a Add libarena from local rust to stage0
This was needed at least when local rust was 1.9.0 on darwin.

Fixes #35149
2016-07-31 16:29:15 -07:00
Alex Crichton
0509be1f6b Update parsing llvm-config output
Now it prints full paths on MSVC, but we're only interested in path names
2016-07-29 10:29:59 +02:00
Tobias Bucher
e7d16580f5 Escape fewer Unicode codepoints in Debug impl of str
Use the same procedure as Python to determine whether a character is
printable, described in [PEP 3138]. In particular, this means that the
following character classes are escaped:

- Cc (Other, Control)
- Cf (Other, Format)
- Cs (Other, Surrogate), even though they can't appear in Rust strings
- Co (Other, Private Use)
- Cn (Other, Not Assigned)
- Zl (Separator, Line)
- Zp (Separator, Paragraph)
- Zs (Separator, Space), except for the ASCII space `' '` (`0x20`)

This allows for user-friendly inspection of strings that are not
English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`).

Fixes #34318.

[PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-23 00:18:44 +02:00
bors
dc8212ff20 Auto merge of #34779 - infinity0:master, r=alexcrichton
If local-rust is the same as the current version, then force a local-rebuild

In Debian, we would like the option to build/rebuild the current release from
*either* the current or previous stable release. So we use enable-local-rust
instead of enable-local-rebuild, and read the bootstrap key dynamically from
whatever is installed locally.

In general, it does not make much sense to allow enable-local-rust without also
setting the bootstrap key, since the build would fail otherwise.

(The way I detect "the bootstrap key of [the local] rustc installation" is a bit hacky, suggestions welcome.)
2016-07-16 01:19:16 -07:00
Ximin Luo
c850470f73 mk: If local-rust is the same as the current version, then force a local-rebuild 2016-07-15 19:37:15 +02:00
bors
3e15fcc55e Auto merge of #34599 - cuviper:unicode-9.0, r=alexcrichton
Update Unicode tables to 9.0

I just updated `unicode.py`'s generated copyright year, then ran it.
2016-07-14 17:29:16 -07:00
bors
801d2682df Auto merge of #34689 - alexcrichton:fix-nightlies, r=alexcrichton
First attempt to fix nightlies

This is just https://github.com/rust-lang/rust/pull/34669 but I added some comments so it can land.
2016-07-06 14:05:35 -07:00
Alex Crichton
01c4b64b1c etc: Comment why we're binding xrange
Just mention there are differences between python versions
2016-07-06 11:17:26 -07:00
Alex Crichton
ab216a96aa Merge branch 'master' of https://github.com/dzamlo/rust into fix-nightlies 2016-07-06 11:16:33 -07:00
bors
a120ae70d0 Auto merge of #34644 - infinity0:master, r=alexcrichton
Avoid redundant downloads when bootstrapping

If the local file is available, then verify it against the hash we just
downloaded, and if it matches then we don't need to download it again.
2016-07-06 03:30:47 -07:00
Loïc Damien
51e89ab08b Use lazy range in gdb pretty printers 2016-07-05 19:57:44 +02:00
bors
ec58d0c997 Auto merge of #34412 - gnzlbg:document_platform_intrinsics_generate, r=alexcrichton
Add x86 intrinsics for bit manipulation (BMI 1.0, BMI 2.0, and TBM).

This PR adds the LLVM x86 intrinsics for the bit manipulation instruction sets (BMI 1.0, BMI 2.0, and TBM).

The objective of this pull-request is to allow building a library that implements all the algorithms offered by those instruction sets, using compiler intrinsics for the targets that support them (by means of `target_feature`).

The target features added are:

- `bmi`: Bit Manipulation Instruction Set 1.0, available in Intel >= Haswell and AMD's >= Jaguar/Piledriver,
- `bmi2`: Bit Manipulation Instruction Set 2.0, available in Intel >= Haswell and AMD's >= Excavator,
- `tbm`: Trailing Bit Manipulation, available only in AMD's Piledriver (won't be available in newer CPUs).

The intrinsics added are:

- BMI 1.0:
  - `bextr`: Bit field extract (with register).
- BMI 2.0:
  - `bzhi`: Zero high bits starting with specified bit position.
  - `pdep`: Parallel bits deposit.
  - `pext`: Parallel bits extract.
- TBM:
 - `bextri`: Bit field extract (with immediate).
2016-07-05 08:25:37 -07:00
bors
0f4c4f8c29 Auto merge of #34646 - michaelwoerister:warn-blacklisted-lldb, r=alexcrichton
Make rust-lldb warn about unsupported versions of LLDB

r? @alexcrichton
2016-07-04 17:59:14 -07:00
Michael Woerister
6be6289338 Make rust-lldb warn about unsupported versions of LLDB 2016-07-04 19:37:36 -04:00
bors
d7ef1ac0d0 Auto merge of #34639 - dzamlo:master, r=michaelwoerister
Use lazy iterator in vec/slice gdb pretty printers
2016-07-04 15:09:36 -07:00
Loïc Damien
5de76afcfd Use lazy iterator in vec/slice gdb pretty printers 2016-07-04 20:22:10 +02:00
Ximin Luo
ab5309e9e8 Avoid redundant downloads when bootstrapping
If the local file is available, then verify it against the hash we just
downloaded, and if it matches then we don't need to download it again.
2016-07-04 16:37:46 +02:00
Nikhil Shagrithaya
036b08917d Added a pretty printer for &mut slices 2016-07-04 00:04:19 +05:30
Josh Stone
452e4edaa0 Update Unicode tables to 9.0 2016-07-01 09:46:53 -07:00
bors
8c63d12dc3 Auto merge of #34055 - brson:cmake, r=alexcrichton
Convert makefiles to build LLVM/compiler-rt with CMake

This is certainly buggy, but I have successfully built on x86_64-unknown-linux-gnu and x86_64-pc-windows-gnu. I haven't built successfully on mac yet, and I've seen mysterious test failures on Linux, but I'm interested in throwing this at the bots to see what they think.
2016-06-23 23:33:32 -07:00
gnzlbg
483bec790b Add target_features for the bit manipulation instruction sets: BMI 1.0, BMI 2.0, and TBM. 2016-06-22 17:11:17 +02:00
gnzlbg
10cbc37cdd Add intrinsics for x86 bit manipulation instruction sets: BMI 1.0, BMI 2.0, and TBM. 2016-06-22 16:34:10 +02:00
gnzlbg
152055451c Allow different instruction set prefixes within the same architecture 2016-06-22 16:30:55 +02:00
gnzlbg
cb4f54dc04 Add usage examples to the documentation of etc/platform-intrinsics/generator.py 2016-06-22 14:20:37 +02:00
Brian Anderson
59db95b499 Convert makefiles to build LLVM/compiler-rt with CMake 2016-06-21 19:54:28 -07:00
Seo Sanghyeon
9d03128f58 Run debuginfo tests on Travis 2016-06-20 19:31:07 +09:00
Seo Sanghyeon
b1651fb4d2 Use Docker for Travis 2016-06-03 11:44:30 +09:00
bors
433d70cda2 Auto merge of #33141 - tshepang:python-love, r=brson
some Python nits and fixes
2016-05-31 21:37:42 -07:00
Alex Crichton
fa45670ce4 mk: Prepare for a new stage0 compiler
This commit prepares the source for a new stage0 compiler, the 1.10.0 beta
compiler. These artifacts are hot off the bots and should be ready to go.
2016-05-31 16:11:49 -07:00
Oliver Schneider
b0c7033042
print enum variant fields in docs 2016-05-30 16:11:53 +02:00
bors
4c6b6c200b Auto merge of #33098 - raphlinus:master, r=alexcrichton
Efficient trie lookup for boolean Unicode properties

Replace binary search of ranges with trie lookup using leaves of
64-bit bitmap chunks. Benchmarks suggest this is approximately 10x
faster than the bsearch approach.
2016-05-23 02:48:11 -07:00
bors
b358319353 Auto merge of #33612 - royalstream:royalstream-enc-enum-ptr, r=michaelwoerister
gdb Pretty Print: generic encoded was failing on reference/pointer types

If you debug this program using **gdb**
```rust
fn main() {
    let x = 10;
    let y = Some(&x);
    // additional code
}
```
And you try to print **y**'s value from the debugger, you get the following:
```
(gdb) print y
Python Exception <class 'gdb.error'> Cannot convert value to int.:
$1 = {RUST$ENCODED$ENUM$0$None = Some = {0x7fff5fbff97c}}
```
What happens is that inside **debugger_pretty_printers_common.py** the method `is_null_variant` doesn't have any special handling for pointer values so it ends up calling `.as_integer()` on `discriminant_val` (which holds a pointer) and fails.

Considering it needs to handle pointers and return _true_ when the pointer is _null_, I modified the `.as_integer()` method in **gdb_rust_pretty_printing.py** to take pointers into consideration.

After this modification **gdb** prints **y** like this:
```
(gdb) print y
$1 = Some = {0x7fff5fbff97c}
```
Now, it would be nice to print something useful (instead of a pointer address) but the pretty printer doesn't currently handle references/pointers so that's a completely different subject.
2016-05-15 05:26:50 -07:00
Steven Burns
04baf2593e Generic encoded enums no longer crash on reference/pointer types 2016-05-12 22:01:49 -06:00
Anton Blanchard
0a380897a8 Copy more libraries from local Rust to stage0
When bootstrapping Rust using a previously built toolchain, I noticed
a number of libraries were not copied in. As a result the copied in
rustc fails to execute because it can't find all its dependences.

Add them into the local_stage0.sh script.
2016-05-10 15:12:19 +10:00
Alex Crichton
126e09e5e5 test: Move run-make tests into compiletest
Forcing them to be embedded in makefiles precludes being able to run them in
rustbuild, and adding them to compiletest gives us a great way to leverage
future enhancements to our "all encompassing test suite runner" as well as just
moving more things into Rust.

All tests are still Makefile-based in the sense that they rely on `make` being
available to run them, but there's no longer any Makefile-trickery to run them
and rustbuild can now run them out of the box as well.
2016-04-28 21:46:40 -07:00
Tshepang Lekhonkhobe
a422b7e4ed some Python nits and fixes 2016-04-26 00:34:19 +02:00
Vadim Petrochenkov
4bd44be369 Fix keyword parsing tests 2016-04-24 21:35:50 +03:00
bors
8d0dd7876e Auto merge of #33153 - mitaa:rdoc-dejavu, r=alexcrichton
rustdoc: Only record the same impl once

Due to inlining it is possible to visit the same module multiple times during `<Cache as DocFolder>::fold_crate`, so we keep track of the modules we've already visited.

fixes #33054

r? @alexcrichton
2016-04-23 18:02:06 -07:00
bors
ef57fb7144 Auto merge of #33084 - alexcrichton:osx-python-sanity, r=michaelwoerister
Sanity check Python on OSX for LLDB tests

Two primary changes:

* Don't get past the configure stage if `python` isn't coming from `/usr/bin`
* Call `debugger.Terminate()` to prevent segfaults on newer versions of LLDB.

Closes #32994
2016-04-23 01:18:03 -07:00
mitaa
8ab2c20d8c Only record the same impl once
Due to inlining it is possible to visit the same module multiple times
during `<Cache as DocFolder>::fold_crate`, so we keep track of the
modules we've already visited.
2016-04-22 19:10:30 +02:00
Raph Levien
cfaf66c94e Add comment, reduce storage requirements
Adds a comment which explains the trie structure, and also does a
little arithmetic on lookup (no measurable impact, looks like modern
CPUs do this arithmetic in parallel with the memory lookup to find the
node) to save a bit of space. As a result, the memory impact of the
compiled tables is within a couple hundred bytes of the old
bsearch-range structure.
2016-04-20 21:56:35 -07:00
Raph Levien
6923bc5fc7 Fix wrong shift in trie_lookup_range_table
Somehow got in my head that >> 8 was the right shift for a chunk of 64.
Oops, sorry.
2016-04-19 12:52:23 -07:00
Raph Levien
4864e0e90b Efficient trie lookup for boolean Unicode properties
Replace binary search of ranges with trie lookup using leaves of
64-bit bitmap chunks. Benchmarks suggest this is approximately 10x
faster than the bsearch approach.
2016-04-19 12:25:28 -07:00
Alex Crichton
02538d463a mk: Bootstrap from stable instead of snapshots
This commit removes all infrastructure from the repository for our so-called
snapshots to instead bootstrap the compiler from stable releases. Bootstrapping
from a previously stable release is a long-desired feature of distros because
they're not fans of downloading binary stage0 blobs from us. Additionally, this
makes our own CI easier as we can decommission all of the snapshot builders and
start having a regular cadence to when we update the stage0 compiler.

A new `src/etc/get-stage0.py` script was added which shares some code with
`src/bootstrap/bootstrap.py` to read a new file, `src/stage0.txt`, which lists
the current stage0 compiler as well as cargo that we bootstrap from. This script
will download the relevant `rustc` package an unpack it into `$target/stage0` as
we do today.

One problem of bootstrapping from stable releases is that we're not able to
compile unstable code (e.g. all the `#![feature]` directives in libcore/libstd).
To overcome this we employ two strategies:

* The bootstrap key of the previous compiler is hardcoded into `src/stage0.txt`
  (enabled as a result of #32731) and exported by the build system. This enables
  nightly features in the compiler we download.
* The standard library and compiler are pinned to a specific stage0, which
  doesn't change, so we're guaranteed that we'll continue compiling as we start
  from a known fixed source.

The process for making a release will also need to be tweaked now to continue to
cadence of bootstrapping from the previous release. This process looks like:

1. Merge `beta` to `stable`
2. Produce a new stable compiler.
3. Change `master` to bootstrap from this new stable compiler.
4. Merge `master` to `beta`
5. Produce a new beta compiler
6. Change `master` to bootstrap from this new beta compiler.

Step 3 above should involve very few changes as `master` was previously
bootstrapping from `beta` which is the same as `stable` at that point in time.
Step 6, however, is where we benefit from removing lots of `#[cfg(stage0)]` and
get to use new features. This also shouldn't slow the release too much as steps
1-5 requires little work other than waiting and step 6 just needs to happen at
some point during a release cycle, it's not time sensitive.

Closes #29555
Closes #29557
2016-04-19 10:56:49 -07:00
Alex Crichton
9db6a41687 etc: Add debugger.Terminate() to lldb_batchmode.py
Right now on the most recent version of LLDB installed on OSX we'll segfault on
all the LLDB tests if this isn't called (unfortunately). Hopefully we've updated
LLDB on the bots to actually get this working everywhere!

Closes #32994
2016-04-19 09:39:04 -07:00
Alex Crichton
9dd3c54a2c rustbuild: Migrate tidy checks to Rust
This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc #31590
2016-04-12 08:17:42 -07:00
bors
c8b8eb1fda Auto merge of #32544 - alexcrichton:rustbuild-dist-libtest, r=brson
rustbuild: Fix dist for non-host targets

The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.

There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.

These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.

The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).

All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.

Closes #32523
2016-04-01 12:52:08 -07:00
Alex Crichton
3d6340ffe2 rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.

There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.

These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.

The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).

All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.

Closes #32523
2016-04-01 10:18:36 -07:00
Eduard Burtescu
0abd3139db rustc_platform_intrinsics: remove unused rustc dependency. 2016-03-29 19:36:01 +03:00
Steve Klabnik
7124ea4f18 remove broken config
Fixes #32412
2016-03-24 17:27:15 -04:00
Alex Crichton
87ede2da54 rustc: Improve compile time of platform intrinsics
This commit improves the compile time of `rustc_platform_intrinsics` from 23s to
3.6s if compiling with `-O` and from 77s to 17s if compiling with `-O -g`. The
compiled rlib size also drops from 3.1M to 1.2M.

The wins here were gained by removing the destructors associated with `Type` by
removing the internal `Box` and `Vec` indirections. These destructors meant that
a lot of landing pads and extra code were generated to manage the runtime
representations. Instead everything can basically be statically computed and
shoved into rodata, so all we need is a giant string compare to lookup what's
what.

Closes #28273
2016-03-15 17:32:34 -07:00
Ruud van Asseldonk
e1489caf0b Define AVX blend intrinsics
This defines the `_mm256_blendv_pd` and `_mm256_blendv_ps` intrinsics.
The `_mm256_blend_pd` and `_mm256_blend_ps` intrinsics are not available
as LLVM intrinsics. In Clang they are implemented using the
shufflevector builtin.

Intel reference: https://software.intel.com/en-us/node/524070.
2016-03-13 15:04:14 +01:00