Commit Graph

175 Commits

Author SHA1 Message Date
Mark Rousskov
c68df7c503 Delete lint buffer from Session 2019-11-03 21:52:42 -05:00
Mark Rousskov
c0fdddcb60 Move crate type checking later
This allows us to directly pass in a lint buffer
2019-11-03 21:52:42 -05:00
Mark Rousskov
ea1ff8c07c Utilize Resolver lint buffer during HIR lowering 2019-11-03 21:52:42 -05:00
Mark Rousskov
bb0c930f82 Migrate resolver over to internal lint buffer 2019-11-03 21:52:42 -05:00
Mazdak Farrokhzad
fb12c70852 rustc, rustc_passes: don't depend on syntax_expand.
This is done by moving some data definitions to syntax::expand.
2019-10-27 17:05:57 +01:00
Vadim Petrochenkov
94216ce3ad rustc_interface: Remove ExpansionResult and some Steals 2019-10-24 21:12:05 +03:00
Vadim Petrochenkov
3534ca8f49 Turn crate store into a resolver output 2019-10-24 20:54:16 +03:00
Vadim Petrochenkov
5fd796ad06 rustc: Combine resolver outputs into a single struct 2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
fb353f050a resolve: Privatize all resolver fields 2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
2cda75c48f rustc_metadata: Remove unnecessary use of crate store in plugin loader 2019-10-24 20:51:33 +03:00
Mazdak Farrokhzad
7c043e284a
Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakis
Lockless LintStore

This removes mutability from the lint store after registration. Each commit stands alone, for the most part, though they don't make sense out of sequence.

The intent here is to move LintStore to a more parallel-friendly architecture, although also just a cleaner one from an implementation perspective. Specifically, this has the following changes:
 * We no longer implicitly register lints when registering lint passes
    * For the most part this means that registration calls now likely want to call something like:
       `lint_store.register_lints(&Pass::get_lints())` as well as `register_*_pass`.
    * In theory this is a simplification as it's much easier for folks to just register lints and then have passes that implement whichever lint however they want, rather than necessarily tying passes to lints.
 * Lint passes still have a list of associated lints, but a followup PR could plausibly change that
   * This list must be known for a given pass type, not instance, i.e., `fn get_lints()` is the signature instead of `fn get_lints(&self)` as before.
 * We do not store pass objects, instead storing constructor functions. This means we always get new passes when running lints (this happens approximately once though for a given compiler session, so no behavior change is expected).
 * Registration API is _much_ simpler: generally all functions are just taking `Fn() -> PassObject` rather than several different `bool`s.
2019-10-23 22:19:10 +02:00
Mark Rousskov
4e8d1b2292 Add some documentation 2019-10-22 16:53:28 -04:00
Mazdak Farrokhzad
d945f9860f move parse_cfgspecs to rustc_interface 2019-10-19 13:25:46 +02:00
Mark Rousskov
6be0a7081a Update API to be more compatible with plugin needs
Move to using Box<dyn Fn() -> ...> so that we can let plugins register
state.

This also adds a callback that'll get called from plugin registration so
that Clippy and other tools can register lints without using the plugin
API. The plugin API still works, but this new API is more compatible
with drivers other than rustc.
2019-10-17 19:41:21 -04:00
Mark Rousskov
dab3bd6cda Create lint store during plugin registration
Remove lint store from Session
2019-10-17 19:41:21 -04:00
Mark Rousskov
da56d1d201 Remove all borrows of lint store from Session from librustc
Access through tcx is fine -- by that point, the lint store is frozen,
but direct access through Session will go away in future commits, as
lint store is still mutable in early stages of Session, and will be
removed completely.
2019-10-17 19:41:21 -04:00
Mark Rousskov
7fef39791a Make get_lints be a static function
This moves from calling get_lints on instantiated pass objects to the
raw object
2019-10-17 19:16:41 -04:00
Mark Rousskov
68c07db80a No longer implicitly register lints when registering passes
This is in preparation for on-demand constructing passes
2019-10-17 19:16:41 -04:00
Mark Rousskov
e1079c82be Split out just registration to separate function 2019-10-17 19:16:41 -04:00
Mark Rousskov
b060f3b84d Split module and crate late pass registration 2019-10-17 19:16:41 -04:00
Mark Rousskov
748eccd488 Lints being from a plugin is dependent on the lint, not the registration 2019-10-17 19:16:41 -04:00
Mark Rousskov
577d442fe8 De-propagate optional session from lint registration
This is straight up removing dead code, but is a separate commit from
the previous to avoid conflating clean up and important changes.
2019-10-17 19:16:40 -04:00
Mazdak Farrokhzad
d420d719c4 move syntax::ext to new crate syntax_expand 2019-10-16 10:59:53 +02:00
Tyler Mandry
6241a4a108
Rollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddyb
Several changes to the codegen backend organization

* Split functions from values in cg_ssa `BackendTypes`.
* Remove `is_const_integral` function from `ConstMethods`.
* Actually register the invalid monomorphization of intrinsic long diagnostic and remove the `diagnostics` method from `CodegenBackends`, as it was unused.
* Add cg_ssa and cg_utils provided methods to `default_provide`, so codegen backend don't have to do it themself.
2019-10-14 17:52:38 -07:00
Vadim Petrochenkov
f5baad2b5e rustc_metadata: Remove resolutions for extern crate items from CStore
Use a more traditional scheme with providing them as a resolver output
2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
e843d867e6 rustc_metadata: Crate loader is immutable 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
e8c28e24b9 rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
Mazdak Farrokhzad
07e946caf7 lowering: connect to parser via function pointer instead 2019-10-13 23:27:18 +02:00
Mazdak Farrokhzad
1899432867 lowering: don't rely on parser directly. 2019-10-13 22:51:18 +02:00
bjorn3
ea60335c28 Add top level provide/provide_extern to cg_ssa and cg_utils 2019-10-13 14:43:58 +02:00
bjorn3
5f203d5988 Move some provides from cg_llvm to rustc_interface 2019-10-13 14:35:14 +02:00
Michael Woerister
ceb1a9cfe3 self-profiling: Add events for everything except trait selection. 2019-10-09 13:40:44 +02:00
Mazdak Farrokhzad
3f2ae44ba4
Rollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, r=michaelwoerister
Remove -Zprofile-queries

r? @michaelwoerister

Per [zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/57361RemoveZprofilequeries.html).
2019-10-08 23:31:20 +02:00
Josh Stone
fa2acbe0d6 Name the threads in rayon's pool 2019-10-07 13:20:17 -07:00
Josh Stone
33c4125fbe Rebase rustc-rayon on rayon-1.2
See also https://github.com/rust-lang/rustc-rayon/pull/3
2019-10-07 13:20:17 -07:00
Mark Rousskov
7c3f65b3c4 middle::intrinsicck -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
82bfd8eb0d middle::entry -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
bb707824d0 middle::dead -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
91a096a9b8 move middle::liveness to rustc_passes 2019-10-04 11:11:33 -04:00
Mazdak Farrokhzad
cb4145e759
Rollup merge of #64874 - matthewjasper:simplify-euv, r=eddyb
Simplify ExprUseVisitor

* Remove HIR const qualification
* Remove parts of ExprUseVisitor that aren't being used

r? @eddyb
2019-10-04 07:24:36 +02:00
Mark Rousskov
e85089b63a Remove -Zprofile-queries 2019-10-03 21:34:27 -04:00
Tyler Mandry
8f5f92a07a
Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, r=wesleywiser
SelfProfiler API refactoring and part one of event review

This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use.

The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented.

There is still some work to be done for adding new events, especially around trait resolution and the incremental system.

r? @wesleywiser
2019-10-01 23:06:16 -07:00
Tyler Mandry
65a050fddc
Rollup merge of #64722 - Mark-Simulacrum:alt-parallel, r=alexcrichton
Make all alt builders produce parallel-enabled compilers

We're not quite ready to ship parallel compilers by default, but the alt
builders are not used too much (in theory), so we believe that shipping
a possibly-broken compiler there is not too problematic.

r? @nikomatsakis
2019-10-01 23:06:11 -07:00
Mark Rousskov
1a1067d1a5 Make the default parallelism 1
This changes the default parallelism for parallel compilers to one,
instead of the previous default, which was "num cpus". This is likely
not an optimal default long-term, but it is a good default for testing
whether parallel compilers are not a significant regression over a
sequential compiler.

Notably, this in theory makes a parallel-enabled compiler behave
exactly like a sequential compiler with respect to the jobserver.
2019-09-30 16:49:19 -04:00
Matthew Jasper
455945f24b Remove HIR based const qualification 2019-09-30 19:56:49 +01:00
Michael Woerister
d94262272b Self-Profiling: Make names of existing events more consistent and use new API. 2019-09-30 13:31:56 +02:00
Alexander Regueiro
d938a8079f Fixed grammar for some time fn calls and a diagnostic. 2019-09-30 01:15:24 +01:00
bors
06c68947ad Auto merge of #64158 - tmandry:libtest-panic-abort, r=alexcrichton
panic=abort support in libtest

Add experimental support for tests compiled with panic=abort. Enabled with `-Z panic_abort_tests`.

r? @alexcrichton
cc @cramertj
2019-09-29 13:53:08 +00:00
Tyler Mandry
3f0254e3cf Put panic=abort test support behind -Z panic_abort_tests 2019-09-28 13:52:18 -07:00
Tyler Mandry
8ae1ec60cc Spawn one subprocess per unit test when panic=abort 2019-09-28 13:52:18 -07:00