38 Commits

Author SHA1 Message Date
John Kåre Alsaker
5a485ce4a3 Use self profile infrastructure for -Z time and -Z time-passes 2020-01-05 02:57:14 +01:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Camille GILLOT
4dc79f1f7d Use Arena inside hir::Crate. 2019-12-21 23:12:44 +01:00
bors
ae1b871cca Auto merge of #65195 - varkor:to_option, r=Centril
Rename `bool::then_*` to `bool::to_option_*` and use where appropriate

Name change following https://github.com/rust-lang/rfcs/pull/2757. Also try it out throughout the compiler in places I think makes the code more readable.
2019-12-06 19:14:51 +00:00
varkor
9f1269f23c Rename to then_some and then 2019-12-06 12:24:54 +00:00
varkor
e3a8ea4e18 Use to_option in various places 2019-12-06 12:23:23 +00:00
Ömer Sinan Ağacan
5ddfbc2e2b Fix Query type docs
`give` no longer exists, `compute` is used to generate query results
now.
2019-12-06 10:41:51 +03:00
Camille GILLOT
1e12f39d83 Allocate HIR Forest on arena. 2019-11-27 13:32:28 +01:00
Camille GILLOT
e321ba989c Misc renames. 2019-11-27 13:24:19 +01:00
Camille GILLOT
77a4c85e54 Simplify handling of AllArenas. 2019-11-27 13:19:33 +01:00
Camille GILLOT
e5ed101098 Rename BoxedGlobalCtxt. 2019-11-27 13:17:58 +01:00
Camille GILLOT
79e232401e Rename lifetimes. 2019-11-27 13:13:57 +01:00
Camille GILLOT
7e72b36299 Move local Arena to Queries. 2019-11-26 23:16:48 +01:00
Camille GILLOT
b99513be57 Have Queries own the GlobalCtxt.
The construction of the GlobalCtxt is moved from a generator's stack to
the Queries struct.  Since the GlobalCtxt requires the HIR Forest and the
arenas to live longer, those are moved into Queries the same way.

The resulting handling of objects is more brittle, because consumers of
the Once objects need to be careful of their initialisation.
2019-11-26 22:51:02 +01:00
Camille GILLOT
144d1c2171 Review nits. 2019-11-26 17:20:32 +01:00
Camille GILLOT
9d5f721406 Superfluous lifetime. 2019-11-25 18:36:18 +01:00
Camille GILLOT
ea1b8039ad Pass Queries by reference. 2019-11-25 18:13:29 +01:00
Camille GILLOT
18bb912984 Remove wrong comment. 2019-11-25 17:54:01 +01:00
Camille GILLOT
27513a21c4 Tidy. 2019-11-24 23:21:44 +01:00
Camille GILLOT
5098ba6a93 Move linking ouside the interface queries. 2019-11-24 23:21:43 +01:00
Camille GILLOT
266ede1bb3 Isolate compiler queries inside the Queries type. 2019-11-24 23:21:43 +01:00
Vadim Petrochenkov
f89e6c8811 rustc_plugin: Remove support for syntactic plugins 2019-11-24 12:05:10 +03: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
2cda75c48f rustc_metadata: Remove unnecessary use of crate store in plugin loader 2019-10-24 20:51:33 +03: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
b8a040fc5f Remove tx_to_llvm_workers from TyCtxt
This can be kept within the codegen backend crates entirely
2019-09-25 16:57:27 -04:00
Nicholas Nethercote
2521189438 Add a comment to Compiler::compile().
`Compiler::compile()` is different to all the other `Compiler` methods
because it lacks a `Queries` entry. It only has one call site, which is
in a test that doesn't need its specific characteristics.

This patch replaces that call with a call to `Compile::link()`, which is
similar enough for the test's purposes. It also notes that the method is
an illustrative example of how `Compiler` can be used.
2019-09-19 06:56:52 +10:00
Nicholas Nethercote
d264a56068 Move call site of dep_graph_future().
`Compiler::register_plugins()` calls `passes::register_plugins()`, which
calls `Compiler::dep_graph_future()`. This is the only way in which a
`passes` function calls a `Compiler` function.

This commit moves the `dep_graph_future()` call out of
`passes::register_plugins()` and into `Compiler::register_plugins()`,
which is a more sensible spot for it. This will delay the loading of the
dep graph slightly -- from the middle of plugin registration to the end
of plugin registration -- but plugin registration is fast enough
(especially compared to expansion) that the impact should be neglible.
2019-09-11 10:59:05 +10:00
Nicholas Nethercote
cd0c21b0e5 Remove lower_to_hir() call from prepare_output().
It's a false dependency. The result isn't used and there are no
relevant side-effects.
2019-09-02 08:46:31 +10:00
Nicholas Nethercote
d61605cef8 Don't call self.parse() in Compiler::crate_name() unless necessary. 2019-09-02 08:46:31 +10:00
Mark Rousskov
2d18504c27 Remove Option from resolver 2019-08-10 07:52:07 -04:00
Vadim Petrochenkov
434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
Vadim Petrochenkov
614037171b cleanup: Remove extern crate serialize as rustc_serializes 2019-07-23 19:20:16 +03:00
Mazdak Farrokhzad
14f3f6c712 librustc_interface => 2018 2019-03-27 09:41:42 +01:00
John Kåre Alsaker
51938c61f6 Make the rustc driver and interface demand driven 2019-03-10 04:49:45 +01:00