about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/queries.rs
AgeCommit message (Collapse)AuthorLines
2023-11-22Make `Compiler::{sess,codegen_backend}` public.Nicholas Nethercote-21/+14
And remove the relevant getters on `Compiler` and `Queries`.
2023-11-22Add comments about a timer.Nicholas Nethercote-0/+3
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-17Make `Compiler::sess` private.Nicholas Nethercote-1/+1
Like `Compiler::codegen_backend`.
2023-11-17Remove a low-value local variable.Nicholas Nethercote-3/+2
2023-11-17Rename `Linker::prepare_outputs` as `output_filenames`.Nicholas Nethercote-5/+5
It matches the type, and a noun makes more sense than a verb. The `output_filenames` function still uses a profiling label named `prepare_outputs`, but I think that makes sense as a verb and can be left unchanged.
2023-11-17Move `CodegenBackend` out of `Linker`.Nicholas Nethercote-11/+6
It can easily be passed in. And that removes the single clone of `Compiler::codegen_backend`, which means it no longer needs to be `Lrc`.
2023-11-17Move `Session` out of `Linker`.Nicholas Nethercote-16/+10
It can easily be passed in. And that removes the single clone of `Compiler::session`, which means it no longer needs to be `Lrc`.
2023-11-17Streamline `Queries::linker`.Nicholas Nethercote-19/+13
2023-11-17Move `lint_store` from `GlobalCtxt` to `Session`.Nicholas Nethercote-7/+0
This was made possible by the removal of plugin support, which simplified lint store creation. This simplifies the places in rustc and rustdoc that call `describe_lints`, which are early on. The lint store is now built before those places, so they don't have to create their own lint store for temporary use, they can just use the main one.
2023-11-17Inline and remove `create_lint_store`.Nicholas Nethercote-2/+6
2023-11-04Remove support for compiler plugins.Nicholas Nethercote-6/+2
They've been deprecated for four years. This commit includes the following changes. - It eliminates the `rustc_plugin_impl` crate. - It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`. - E0457 and E0498 are no longer used. - E0463 is narrowed, now only relating to unfound crates, not plugins. - The `plugin` feature was moved from "active" to "removed". - It removes the entire plugins chapter from the unstable book. - It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`. Closes #29597.
2023-10-25Stop telling people to submit bugs for internal feature ICEsNilstrieb-3/+5
This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. See MCP 620.
2023-09-24Don't use a thread to load the dep graphJohn Kåre Alsaker-44/+3
2023-09-11Rollup merge of #115730 - bjorn3:some_driver_refactors, r=compiler-errorsMatthias Krüger-0/+2
Some more small driver refactors To improve clarity and simplify some code.
2023-09-10Deprecate the pre_configure querybjorn3-0/+2
Only deprecating it rather than making it private to just in case someone has a use case for it.
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-4/+2
2023-09-02Rename `Freeze` to `FreezeLock`John Kåre Alsaker-2/+4
2023-09-02Add `Freeze` type and use it to store `Definitions`John Kåre Alsaker-2/+2
2023-09-01Use `OnceLock` for `SingleCache`John Kåre Alsaker-3/+3
2023-08-14Fix review commentbjorn3-1/+1
2023-08-13Remove metadata_loader querybjorn3-4/+4
It is only used by CrateLoader. We can store the metadata loader in CStore instead which CrateLoader has access to.
2023-08-13Pass WorkProductMap to build_dep_graph instead of FxIndexMapbjorn3-9/+1
Constructing an FxIndexMap is useless work as the iteration order never matters.
2023-08-13Inline queries for crate_name, crate_types and stable_crate_idbjorn3-45/+19
All of them are not exported from rustc_interface and used only during global_ctxt(). Inlining them makes it easier to follow the order of queries and slightly reduces line count.
2023-08-11rustc: Move `features` from `Session` to `GlobalCtxt`Vadim Petrochenkov-4/+3
Removes two pieces of mutable state. Follow up to #114622.
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-2/+2
Removes a piece of mutable state. Follow up to #114578.
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-2/+2
Removes a piece of mutable state. Follow up to #114578.
2023-08-07rustc_interface: Dismantle `register_plugins` queryVadim Petrochenkov-73/+90
2023-06-22Avoid `Lrc<Box<dyn CodegenBackend>>`.Nicholas Nethercote-3/+3
Because `Lrc<Box<T>>` is silly. (Clippy warns about `Rc<Box<T>>` and `Arc<Box<T>>`, and it would warn here if (a) we used Clippy with rustc, and (b) Clippy knew about `Lrc`.)
2023-06-21Remove Queries::ongoing_codegen.Nicholas Nethercote-18/+11
There's no need to store it in `Queries`. We can just use a local variable, because it's always used shortly after it's produced. The commit also removes the `tcx.analysis()` call in `ongoing_codegen`, because it's easy to ensure that's done beforehand. All this makes the dataflow within `run_compiler` easier to follow, at the cost of making one test slightly more verbose, which I think is a good tradeoff.
2023-06-08Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few ↵Andrew Xie-3/+8
misc issues, added collect to UnordItems
2023-06-04Switched some uses to UnordMapAndrew Xie-1/+3
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-1/+1
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-01Change rlink serialization from `MemEncoder` to `FileEncoder`.Nicholas Nethercote-2/+1
Because we're writing to a file, so `FileEncoder` is better because we don't have to write all the data to memory first.
2023-04-26Remove QueryEngine traitJohn Kåre Alsaker-4/+0
2023-04-04Add a usize-indexed append-only-vecOli Scherer-2/+2
2023-03-23rustc_interface: Add a new query `pre_configure`Vadim Petrochenkov-10/+31
It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early. Crate-level cfg attributes are then expanded normally during the main expansion pass, like attributes on any other nodes.
2023-03-23expand: Pass `ast::Crate` by reference to AST transforming passesVadim Petrochenkov-3/+3
Also some more attributes are passed by reference.
2023-03-08Only compute the crate hash when necessary.Nicholas Nethercote-2/+7
The crate hash is needed: - if debug assertions are enabled, or - if incr. comp. is enabled, or - if metadata is being generated, or - if `-C instrumentation-coverage` is enabled. This commit avoids computing the crate hash when these conditions are all false, such as when doing a release build of a binary crate. It uses `Option` to store the hashes when needed, rather than computing them on demand, because some of them are needed in multiple places and computing them on demand would make compilation slower. The commit also removes `Owner::hash_without_bodies`. There is no benefit to pre-computing that one, it can just be done in the normal fashion.
2023-02-21Use a lock-free datastructure for `source_span`Oli Scherer-4/+2
2023-02-20Move the resolver into a queryOli Scherer-27/+4
2023-02-20Make `configure_and_expand` "infalllible" by just aborting the compilation ↵Oli Scherer-3/+2
if it fails instead of bubbling out an error
2023-02-20Use tcx queries instead of passing the values to `configure_and_expand`.Oli Scherer-8/+2
2023-02-20Stuff a TyCtxt into the ResolverOli Scherer-2/+1
2023-02-20Run the resolver after TyCtxt constructionOli Scherer-38/+53
2023-02-20Make untracked.cstore lockable so that resolution can still write to it when ↵Oli Scherer-0/+3
using TyCtxt
2023-02-14Simplify expansion logicOli Scherer-3/+3
2023-02-14Inline the expansion queryOli Scherer-28/+23
2023-02-14Remove BoxedResolverOli Scherer-13/+16
2023-02-13rustc_resolve: Remove `Resolver::clone_output`Vadim Petrochenkov-6/+4
And remove `Clone` impls and `Lrc`s that are no longer necessary