Commit Graph

324 Commits

Author SHA1 Message Date
Michael Woerister
64a738d8ce Support local ThinLTO with incremental compilation. 2018-08-31 15:22:52 +02:00
Pietro Albini
ba832707cf
Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelix
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.

Most of the compiler uses the `Fx` hasher but some places ended up with the default one.
2018-08-30 20:15:29 +02:00
Alex Crichton
1fd45a13de Fix warnings about the native target-cpu
This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322
2018-08-28 13:32:11 -07:00
Eduard-Mihai Burtescu
93f3f5b155 Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc. 2018-08-28 17:04:04 +03:00
bors
d2048b6db3 Auto merge of #52101 - japaric:linker-flavor, r=alexcrichton
try to infer linker flavor from linker name and vice versa

This is a second take on PR #50359 that implements the logic proposed in https://github.com/rust-lang/rust/pull/50359#pullrequestreview-116663121

With this change it would become possible to link `thumb*` binaries using GNU's LD on stable as `-C linker=arm-none-eabi-ld` would be enough to change both the linker and the linker flavor from their default values of `arm-none-eabi-gcc` and `gcc`.

To link `thumb*` binaries using rustc's LLD on stable `-Z linker-flavor` would need to be stabilized as `-C linker=rust-lld -Z linker-flavor=ld.lld` are both required to change the linker and the linker flavor, but this PR doesn't propose that. We would probably need some sort of stability guarantee around `rust-lld`'s name and availability to make linking with rustc's LLD truly stable.

With this change it would also be possible to link `thumb*` binaries using a system installed LLD on stable using the `-C linker=ld.lld` flag (provided that `ld.lld` is a symlink to the system installed LLD).

r? @alexcrichton
2018-08-20 01:12:58 +00:00
Donato Sciarra
062bfbf39b mv codemap source_map 2018-08-19 23:01:01 +02:00
Donato Sciarra
d3fe97f3d3 mv codemap() source_map() 2018-08-19 23:01:01 +02:00
Donato Sciarra
82607d2cf3 mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
Donato Sciarra
c655473378 mv CodeMap SourceMap 2018-08-19 23:00:59 +02:00
Michael Woerister
2d2cd21f95 Clean up CodegenUnit name generation. 2018-08-15 13:47:39 +02:00
Jorge Aparicio
eb74f21f5a try to infer linker flavor from linker name and vice versa 2018-08-09 16:08:36 -05:00
Mark Rousskov
a8e19bec37 Move span_bug and bug helper functions to util 2018-08-09 10:01:45 -06:00
Mark Rousskov
ed246fcc95 Cache ignored attributes inside ICH entirely 2018-08-09 10:00:25 -06:00
Mark Rousskov
bd6fe1e700 Move Fingerprint to data structures 2018-08-09 10:00:25 -06:00
Mark Rousskov
ac4439c5b6 Reuse Hash impls for session data structures 2018-08-09 10:00:25 -06:00
Michael Woerister
3a70050377 Address review comments for #53031 and fix some merge fallout. 2018-08-08 13:40:23 +02:00
Michael Woerister
3a3b3317d9 Fix issue around dllimport and ThinLTO as LLD runs it. 2018-08-07 14:44:48 +02:00
Mark Rousskov
0ae2aa2320 Use diagnostic API on Session 2018-08-04 06:54:36 -06:00
Mark Rousskov
e59e02ef46 Privatize some exports from code_stats 2018-08-04 06:53:15 -06:00
Wesley Wiser
256a6e4fa9 Include additional data in the json output 2018-08-02 18:57:24 -04:00
Wesley Wiser
51cc594e10 First pass at json output 2018-08-02 18:57:24 -04:00
Wesley Wiser
45482c6f99 Basic profiling 2018-08-02 18:57:24 -04:00
Shotaro Yamada
3170956276 Remove unused option flag 2018-07-27 17:42:41 +09:00
Oliver Schneider
56c90774a9 Make sure the compiler actually panics on delay_span_bug
Even if that is just happening because of `abort_if_errors`
2018-07-20 15:59:21 +02:00
Michael Woerister
6064efe928 Revert "Clean up CodegenUnit name generation."
This reverts commit 2c5cd9ce53.
2018-07-16 08:58:40 +02:00
Michael Woerister
2c5cd9ce53 Clean up CodegenUnit name generation. 2018-07-11 17:52:57 +02:00
bors
11432ba980 Auto merge of #51230 - nikic:no-verify-lto, r=pnkfelix
Disable LLVM verification by default

Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO.

Also wondering what the sentiment is on disabling verification by default (and e.g. only enabling it on ALT builds with assertions). This does not seem terribly useful outside of rustc development and it does seem to show up in profiles (at something like 3%).

**EDIT:** A table showing the various configurations and what is enabled when.

| Configuration | Dynamic verification performed | LLVM static assertions compiled in |
| --- | --- | --- |
| alt builds | | yes |
| nightly builds | | no |
| stable builds | | no |
| CI builds | | |
| dev builds in a checkout | | |
2018-07-11 12:12:13 +00:00
Guillaume Gomez
1ff7f04120 Fix rustdoc run failures by shutting down definitely some lints 2018-07-05 17:18:45 +02:00
Nikita Popov
22cf833dd1 Rename -Z no-verify to -Z verify-llvm-ir
This disables IR verification by default.
2018-06-12 21:23:06 +02:00
John Kåre Alsaker
9eb4f7329b Fix optimization_fuel 2018-06-01 14:55:55 +02:00
Manish Goregaokar
30bd586bec Stabilize suggestion applicability field in json output 2018-05-21 10:48:12 -07:00
Irina Popa
b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00
John Kåre Alsaker
022dff47e3 Add a Rayon thread pool 2018-05-13 01:28:20 +02:00
Michael Woerister
a9810899a2 Allow for specifying a linker plugin for cross-language LTO 2018-05-09 16:42:35 +02:00
Simonas Kazlauskas
09d2db4e96 Rework force-frame-pointer
This reworks the force-frame-pointer PR to explicitly only consider the
value of the flag if it is provided, and use a target default otherwise.

Something that was tried but not kept was renaming the flag to
`frame-pointer`, because for flag `frame-pointer=no`, there is no
guarante, that LLVM will elide *all* the frame pointers; oposite of what
the literal reading of the flag would suggest.
2018-05-01 10:44:44 +03:00
Björn Steinbrink
5b800c231f Don't force-enable frame pointers when generating debug info
We apparently used to generate bad/incomplete debug info causing
debuggers not to find symbols of stack allocated variables. This was
somehow worked around by having frame pointers.

With the current codegen, this seems no longer necessary, so we can
remove the code that force-enables frame pointers whenever debug info
is requested.

Since certain situations, like profiling code profit from having frame
pointers, we add a -Cforce-frame-pointers flag to always enable frame
pointers.

Fixes #11906
2018-05-01 10:44:44 +03:00
bors
9ff8ec8fdf Auto merge of #50204 - Manishearth:approx-enum, r=estebank
Use enum for approximate suggestions

r? @nrc @killercup
2018-04-30 05:38:06 +00:00
Irina Popa
38e964077b Rename rustc_back::target to rustc_target::spec. 2018-04-26 16:39:44 +03:00
Irina Popa
6f03b80020 rustc_back: move LinkerFlavor, PanicStrategy, and RelroLevel to target. 2018-04-26 16:39:27 +03:00
Manish Goregaokar
4e2cd4104a Approximate -> Applicability 2018-04-25 14:55:25 -07:00
bors
81135c9dbc Auto merge of #50134 - andjo403:jobserver, r=michaelwoerister
make rustdoc test follow the jobserver limit of threads

fix that to many threads is executing at the same time
when rustdoc test is executed.
2018-04-25 11:40:18 +00:00
Andreas Jonson
ed318dd991 make rustdoc test follow the jobserver limit of threadsfix that to many threads is executing at the same timewhen rustdoc test is executed. 2018-04-23 17:02:01 +02:00
Kurtis Nusbaum
51f51109ce add --edition option 2018-04-19 13:57:01 -07:00
John Kåre Alsaker
e5fc06da8a Make one_time_diagnostics thread-safe 2018-04-17 16:43:30 +02:00
John Kåre Alsaker
bf06a53265 Make Handler more thread-safe 2018-04-17 16:43:30 +02:00
bors
6b12d361ff Auto merge of #49882 - Zoxc:sync-misc2, r=michaelwoerister
More thread-safety changes

r? @michaelwoerister
2018-04-17 06:46:31 +00:00
John Kåre Alsaker
fe63637350 Use locks for Session.lint_store and Session.buffered_lints 2018-04-16 02:23:55 +02:00
Oliver Schneider
4f6d118048
Don't abort const eval due to long running evals, just warn 2018-04-13 17:56:45 +02:00
John Kåre Alsaker
006f9b2f56 Make Session.injected_panic_runtime thread-safe 2018-04-10 14:40:26 +02:00
John Kåre Alsaker
dacf9ba00f Make Session.injected_allocator and Session.allocator_kind thread-safe 2018-04-10 14:40:26 +02:00