about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/queries.rs
AgeCommit message (Collapse)AuthorLines
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
2023-02-09Remove `QueryContext`.Nicholas Nethercote-13/+14
There is a type `QueryCtxt`, which impls the trait `QueryContext`. Confusingly, there is another type `QueryContext`. The latter is (like `TyCtxt`) just a pointer to a `GlobalContext`. It's not used much, e.g. its `impl` block has a single method. This commit removes `QueryContext`, replacing its use with direct `GlobalCtxt` use.
2023-01-23Store the gctxt instead of fetching it twice.Oli Scherer-1/+1
2023-01-23Make `output_filenames` a real queryOli Scherer-8/+0
2023-01-23Remove another unneeded use of the resolverOli Scherer-2/+7
2023-01-16Avoid one more call site to `Compiler::expansion`Oli Scherer-1/+1
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-12/+4
2023-01-16Group some commonly passed together values into a structOli Scherer-2/+2
2023-01-16remove some arguments that can also be fed at the caller sideOli Scherer-7/+23
2023-01-16Remove `prepare_outputs`Oli Scherer-19/+9
2023-01-12Harden the pre-tyctxt query system against accidental recomputationOli Scherer-48/+60
2022-12-18don't clone Copy typesMatthias Krüger-1/+1
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-10/+11
2022-12-03Remove all but one call site of `prepare_outputs` and fetch the value from ↵Oli Scherer-6/+8
the TyCtxt instead
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-5/+1
2022-09-30Fix typonils-1/+1
2022-09-30Update compiler/rustc_interface/src/queries.rsCamille Gillot-1/+1
2022-09-30Add comment explaining why we flush delayed bugs before codegennils-0/+2
2022-09-27Flush delayed bugs before codegenNilstrieb-0/+2
Sometimes it can happen that invalid code like a TyKind::Error makes its way through the compiler without triggering any errors (this is always a bug in rustc but bugs do happen sometimes :)). These ICEs will manifest in the backend like as cg_llvm not being able to get the layout of `[type error]`, which makes it hard to debug. By flushing before codegen, we display all the delayed bugs, making it easier to trace it to the root of the problem.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+1
by module
2022-08-22Remove use of DiagnosticArgFromDisplayGiacomo Stevanato-6/+2
2022-08-22Move rustc_interface diagnostics to struct SessionDiagnostic derivesGiacomo Stevanato-9/+9
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-06Make AST lowering a query.Camille GILLOT-5/+5
2022-05-10only_local: always check for misuselcnr-4/+1
2022-04-02Address review comments and add a testJakub Beránek-1/+1
2022-04-02Include a header in .rlink files to provide nicer error messages when a ↵Jakub Beránek-3/+3
wrong file is parsed as .rlink
2022-03-16rustc_error: make ErrorReported impossible to constructmark-5/+2
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-02rename ErrorReported -> ErrorGuaranteedmark-2/+2