about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
AgeCommit message (Collapse)AuthorLines
2023-08-27add rustc_abi debugging attributeRalf Jung-1/+2
2023-08-19Do not compute unneeded results.Camille GILLOT-3/+2
2023-08-11rustc: Move `features` from `Session` to `GlobalCtxt`Vadim Petrochenkov-8/+27
Removes two pieces of mutable state. Follow up to #114622.
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-1/+3
Removes a piece of mutable state. Follow up to #114578.
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-4/+7
Removes a piece of mutable state. Follow up to #114578.
2023-08-07rustc_interface: Dismantle `register_plugins` queryVadim Petrochenkov-37/+10
2023-08-04Make MissingDoc a module lint.Camille GILLOT-3/+1
2023-08-04Querify clashing_extern_declarations lint.Camille GILLOT-0/+3
2023-06-21Remove Queries::ongoing_codegen.Nicholas Nethercote-2/+2
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-13Tweak names and docs for vtable statsMaybe Waffle-10/+12
2023-06-13Simplify code as suggested by the reviewMaybe Waffle-15/+6
2023-06-12Collect VTable stats & add `-Zprint-vtable-sizes`Maybe Waffle-0/+94
2023-06-06Write to stdout if `-` is given as output fileJing Peng-28/+47
If `-o -` or `--emit KIND=-` is provided, output will be written to stdout instead. Binary output (`obj`, `llvm-bc`, `link` and `metadata`) being written this way will result in an error unless stdout is not a tty. Multiple output types going to stdout will trigger an error too, as they will all be mixded together.
2023-05-19Auto merge of #111641 - michaelwoerister:debugger-visualizer-fixes, r=cjgillotbors-0/+5
Fix dependency tracking for debugger visualizers This PR fixes dependency tracking for debugger visualizer files by changing the `debugger_visualizers` query to an `eval_always` query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an `eval_always` query, dependency tracking will now reliably detect changes to the visualizer script files themselves. TODO: - [x] perf.rlo - [x] Needs a bit more documentation in some places - [x] Needs regression test for the incr. comp. case Fixes https://github.com/rust-lang/rust/issues/111226 Fixes https://github.com/rust-lang/rust/issues/111227 Fixes https://github.com/rust-lang/rust/issues/111295 r? `@wesleywiser` cc `@gibbyfree`
2023-05-18Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31bors-0/+1
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-0/+1
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-16Turn debugger_visualizers from feed- into regular query.Michael Woerister-6/+0
2023-05-16Fix dependency tracking for debugger visualizersMichael Woerister-0/+11
2023-05-16Auto merge of #108062 - Zoxc:spec-incr, r=cjgillotbors-0/+3
Specialize query execution for incremental and non-incremental This specializes query execution for incremental and non-incremental by passing in a separate `dyn QueryEngine` types, taking advantage of the virtual dispatch to avoid a branch. This ends up duplicating `try_execute_query`, hopefully the compile time cost of that is relatively low. This is a performance improvement for the non-incremental path: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8420s</td><td align="right">1.8331s</td><td align="right"> -0.48%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2652s</td><td align="right">0.2631s</td><td align="right"> -0.78%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0161s</td><td align="right">1.0062s</td><td align="right"> -0.98%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6408s</td><td align="right">1.6197s</td><td align="right">💚 -1.28%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3939s</td><td align="right">6.3558s</td><td align="right"> -0.60%</td></tr><tr><td>Total</td><td align="right">11.1580s</td><td align="right">11.0780s</td><td align="right"> -0.72%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9918s</td><td align="right"> -0.82%</td></tr></table> The incremental path is more neutral: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:initial</td><td align="right">2.2210s</td><td align="right">2.2227s</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3441s</td><td align="right">0.3443s</td><td align="right"> 0.05%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.2919s</td><td align="right">1.2877s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">2.0749s</td><td align="right">2.0721s</td><td align="right"> -0.14%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.9266s</td><td align="right">7.9206s</td><td align="right"> -0.07%</td></tr><tr><td>Total</td><td align="right">13.8585s</td><td align="right">13.8474s</td><td align="right"> -0.08%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9992s</td><td align="right"> -0.08%</td></tr></table> r? `@cjgillot`
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-05-14Specialize query execution for incremental and non-incrementalJohn Kåre Alsaker-0/+3
2023-04-30Use dynamic dispatch for queriesJohn Kåre Alsaker-2/+5
2023-04-26Remove QueryEngine traitJohn Kåre Alsaker-8/+2
2023-04-23Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillotbors-21/+0
Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-21Run `check_match` and `check_liveness` when MIR is built instead of having ↵Oli Scherer-21/+0
an explicit phase for them
2023-04-21Make `check_match` and `check_liveness` take a `LocalDefId`Oli Scherer-1/+1
2023-04-21Ensure mir_drops_elaborated_and_const_checked when requiring codegen.Camille GILLOT-1/+7
2023-04-20Remove WithOptconstParam.Camille GILLOT-2/+1
2023-04-09Migrate `sess.opts.tests` uses to `sess.is_test_crate()`blyxyas-2/+2
2023-04-03Make check_match take a LocalDefId.Camille GILLOT-1/+1
2023-03-23Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholkMatthias Krüger-2/+3
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize` This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.
2023-03-23rustc_interface: Add a new query `pre_configure`Vadim Petrochenkov-24/+27
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-12/+12
Also some more attributes are passed by reference.
2023-03-16Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`John Kåre Alsaker-2/+3
2023-03-13metadata: Remove some more untracked `CStore` methodsVadim Petrochenkov-11/+6
2023-03-06Querify early_lint_checks.Camille GILLOT-18/+23
2023-03-06Querify registered_tools.Camille GILLOT-1/+3
2023-02-22Remove a back compat warningOli Scherer-22/+12
2023-02-20Remove some unnecessary tcx-passingOli Scherer-7/+4
2023-02-20Stop passing in values that one can also get from the tcx lazilyOli Scherer-7/+1
2023-02-20Move the resolver into a queryOli Scherer-1/+31
2023-02-20Make `configure_and_expand` "infalllible" by just aborting the compilation ↵Oli Scherer-12/+11
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-5/+6
2023-02-20Make untracked.cstore lockable so that resolution can still write to it when ↵Oli Scherer-1/+1
using TyCtxt
2023-02-14Remove BoxedResolverOli Scherer-88/+2
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-4/+10
2023-02-13rustc_resolve: Remove `Resolver::clone_output`Vadim Petrochenkov-17/+6
And remove `Clone` impls and `Lrc`s that are no longer necessary
2023-02-09Remove `QueryContext`.Nicholas Nethercote-21/+5
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-02-09Simplify `tls::enter_context`.Nicholas Nethercote-1/+1
2023-02-05rustc_interface: remove huge error importsest31-18/+16