Commit Graph

55143 Commits

Author SHA1 Message Date
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
Alex Crichton
5fa55781bd test: Remove the execution-engine test
We don't actually officially support this at all, and the execution engine
support in LLVM we've had to gut as it's not compiling on MinGW, so just delete
this test for now.
2016-07-29 10:29:59 +02:00
Alex Crichton
e8f76661f1 rustc: Fix data-layout for AArch64 targets
Also relax the assertion whenever we have a custom LLVM root as LLVM may
disagree about exact specifics.
2016-07-29 10:29:44 +02:00
Alex Crichton
d851428cc3 configure: Fix grep invocation for llvm-mc argument 2016-07-29 10:29:44 +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
dc7076b52e [LLVM-3.9] Pass correct relocation model flag 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
ad262d54dc Update compiler-rt 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
d0e5aa4820 Upgrade compiler-rt 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
2bcb2b8990 Upgrade LLVM to include std::thread patch 2016-07-29 10:29:44 +02:00
Jan-Erik Rediger
1798c1aa59 Refactor determining of relocation model into methods 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
12ccff99bf Use relative path to type 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
fba1f8f123 [LLVM-3.9] Setup the compile unit information immediately
Since LLVM reversed the order of the debug info graphs, we need to have
a compile unit that exists *before* any functions (`DISubprogram`s) are
created. This allows the LLVM debug info builder to automatically link
the functions to the compile unit.
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
Jan-Erik Rediger
d22a9a2940 Upgrade to rust-llvm-2016-07-09 2016-07-29 10:29:44 +02:00
bors
d9a911d236 Auto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichton
switch mipsel-musl to soft float

Closes #34922.

r? @alexcrichton
2016-07-28 18:31:54 -07:00
bors
54c0dcfd63 Auto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mw
Enable reuse of `.o` files if nothing has changed

This PR completes a first "spike" for incremental compilation by enabling us to reuse `.o` files when nothing has changed. When in incr. mode, we will save `.o` files into the temporary directory, then copy them back out again if they are still valid. The code is still a bit rough but it does seem to work. =)

r? @michaelwoerister

Fixes #34036
Fixes #34037
Fixes #34038
2016-07-28 14:17:54 -07:00
Niko Matsakis
42cd5d4ee2 make it possible to track where hash diverges 2016-07-28 15:39:34 -04:00
Niko Matsakis
e359147d12 hash def-path's better
actually we shouldn't even hash nested items at all, but that is
addressed in a followup PR
2016-07-28 15:39:02 -04:00
bors
d1df3fecdf Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton
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.
CC #34422.

[PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-28 11:20:33 -07:00
Niko Matsakis
2f9fff2191 Keep multiple files per work-product
In the older version, a `.o` and ` .bc` file were separate
work-products.  This newer version keeps, for each codegen-unit, a set
of files of different kinds. We assume that if any kinds are available
then all the kinds we need are available, since the precise set of
switches will depend on attributes and command-line switches.

Should probably test this: the effect of changing attributes in
particular might not be successfully tracked?
2016-07-28 12:05:45 -04:00
Niko Matsakis
ceeb158e0a Address mw nits 2016-07-28 12:05:45 -04:00
Niko Matsakis
08a72d20c9 Add a testing mechanism and a simple spike test 2016-07-28 12:05:45 -04:00
Niko Matsakis
58d4b8edd3 Modify trans to skip generating .o files
This checks the `previous_work_products` data from the dep-graph and
tries to simply copy a `.o` file if possible.  We also add new
work-products into the dep-graph, and create edges to/from the dep-node
for a work-product.
2016-07-28 12:05:45 -04:00
Niko Matsakis
cca4804251 Code to save/load the work-products map from disk
Work products are deleted if any of their inputs are dirty.
2016-07-28 12:05:04 -04:00
Niko Matsakis
ffc13b2f80 Store crate_disambiguator as an InternedString
We used to use `Name`, but the session outlives the tokenizer, which
means that attempts to read this field after trans has complete
otherwise panic. All reads want an `InternedString` anyhow.
2016-07-28 12:05:04 -04:00
Niko Matsakis
2b38c4bdea Extend DepGraph so it can track "work-products"
A work product right now is just a `.o` file. In the future it probably
includes other kinds of files, such as `.bc` files saving the
unoptimized LLVM IR.

However, because WorkProductIds must be independent of DefIds, so that
they don't need translation, this system may not be suitable *as is* for
storing fine-grained information (such as the MIR for individual defs),
as it was originally intended. We will want to refactor some for that.
2016-07-28 12:05:04 -04:00
bors
748ecb1235 Auto merge of #35086 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #34951, #34963, #34969, #35013, #35037, #35040, #35058
- Failed merges:
2016-07-28 08:19:33 -07:00
Manish Goregaokar
bc283bb8ae Rollup merge of #35040 - soltanmm:couple-is-a-pun, r=nikomatsakis
Use &mut for `CombineFields` in inference relations

Because dropping obligations on the floor makes a mess.

r? @nikomatsakis
2016-07-28 20:33:07 +05:30
Manish Goregaokar
22297bdf98 Rollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichton
rustdoc: Fix tuple struct where clause rendering

For tuple structs the where clause comes after the definition.

Fixes #34928
2016-07-28 20:33:07 +05:30
Manish Goregaokar
be6b73f19d Rollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichton
move coerce-match{,-calls} into run-pass-valgrind

Closes #21696.
2016-07-28 20:33:07 +05:30
Manish Goregaokar
f540f5d453 Rollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrc
Avoid processing `feature`s on unconfigured crates

Fixes #34932, a regression caused by #34272.
r? @nrc
2016-07-28 20:33:06 +05:30
Manish Goregaokar
43bcada397 Rollup merge of #34963 - petrochenkov:useerr, r=jseyfried
resolve: Fix ICE and extra diagnostics happening when unresolved imports are used in patterns

Closes https://github.com/rust-lang/rust/issues/34933

r? @jseyfried
2016-07-28 20:33:06 +05:30
Manish Goregaokar
80c998d0f1 Rollup merge of #34951 - tomgarcia:covariant-vec, r=brson
Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?
2016-07-28 20:33:06 +05:30
bors
cec262e55a Auto merge of #34951 - tomgarcia:covariant-vec, r=brson
Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?
2016-07-28 05:24:31 -07:00
bors
1895bf760d Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc
macros: Improve `tt` matchers

Fixes #5846, fixes #22819.
r? @nrc
2016-07-28 00:01:54 -07:00
Jeffrey Seyfried
448550223b Add regression test 2016-07-28 02:16:11 +00:00
bors
f5d79521ae Auto merge of #34946 - alexcrichton:fix-cfg, r=brson
std: Fix usage of SOCK_CLOEXEC

This code path was intended to only get executed on Linux, but unfortunately the
`cfg!` was malformed so it actually never got executed.
2016-07-27 18:58:04 -07:00
Tobias Bucher
3d09b4a0d5 Rename char::escape to char::escape_debug and add tracking issue 2016-07-28 02:20:49 +02:00