summary refs log tree commit diff
path: root/compiler/rustc_interface/src
AgeCommit message (Collapse)AuthorLines
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-1/+1
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-1/+1
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-25rustc_middle: Rearrange resolver outputs structures slightlyVadim Petrochenkov-11/+3
2022-10-23Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`sJakub Beránek-0/+1
2022-10-23Migrate all diagnosticsNilstrieb-14/+14
2022-10-21Auto merge of #103310 - lcnr:rustc_hir_typeck, r=compiler-errorsbors-0/+1
move hir typeck into separate crate second part https://github.com/rust-lang/compiler-team/issues/529 I avoided pretty much anything that wasn't just a simple move + path adjustment. Left fixmes for methods which are at an odd place r? `@compiler-errors`
2022-10-20rustc_hir_typeck: fix paths and partially mv fileslcnr-0/+1
2022-10-19Add a comment to `Compiler`.Nicholas Nethercote-1/+4
It took me a while to work this out.
2022-10-19Clarify `run_in_thread_pool_with_globals`.Nicholas Nethercote-44/+45
- Make the structure of the two variants more similar. - Add some comments. - Move various conditional `use` items inside the function that uses them. - Inline some closures.
2022-10-19Replace a `spawn_unchecked` with `spawn_scoped`.Nicholas Nethercote-12/+16
2022-10-19Apply `Lrc` later to `sess` and `codegen_backend`.Nicholas Nethercote-10/+5
This avoids the need for a degenerate `Lrc::get_mut` call.
2022-10-19Inline and remove `create_compiler_and_run`.Nicholas Nethercote-53/+51
It has a single call site.
2022-10-19Reduce visibility of some functions.Nicholas Nethercote-3/+3
2022-10-19Inline and remove `scoped_thread`.Nicholas Nethercote-15/+9
It has a single call site, and removing it slightly improves the confusing tangle of nested closures present at startup.
2022-10-18Remove `RunCompiler::emitter`.Nicholas Nethercote-17/+4
It's no longer used.
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-11/+16
2022-10-10Move lifetime resolution module to rustc_hir_analysis.Camille GILLOT-1/+0
2022-10-06Remove `-Ztime` option.Nicholas Nethercote-1/+0
The compiler currently has `-Ztime` and `-Ztime-passes`. I've used `-Ztime-passes` for years but only recently learned about `-Ztime`. What's the difference? Let's look at the `-Zhelp` output: ``` -Z time=val -- measure time of rustc processes (default: no) -Z time-passes=val -- measure time of each rustc pass (default: no) ``` The `-Ztime-passes` description is clear, but the `-Ztime` one is less so. Sounds like it measures the time for the entire process? No. The real difference is that `-Ztime-passes` prints out info about passes, and `-Ztime` does the same, but only for a subset of those passes. More specifically, there is a distinction in the profiling code between a "verbose generic activity" and an "extra verbose generic activity". `-Ztime-passes` prints both kinds, while `-Ztime` only prints the first one. (It took me a close reading of the source code to determine this difference.) In practice this distinction has low value. Perhaps in the past the "extra verbose" output was more voluminous, but now that we only print stats for a pass if it exceeds 5ms or alters the RSS, `-Ztime-passes` is less spammy. Also, a lot of the "extra verbose" cases are for individual lint passes, and you need to also use `-Zno-interleave-lints` to see those anyway. Therefore, this commit removes `-Ztime` and the associated machinery. One thing to note is that the existing "extra verbose" activities all have an extra string argument, so the commit adds the ability to accept an extra argument to the "verbose" activities.
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-27rustc_typeck to rustc_hir_analysislcnr-3/+2
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-25Rollup merge of #101997 - cuviper:drop-legacy-pm, r=nikicfee1-dead-1/+0
Remove support for legacy PM This removes support for optimizing with LLVM's legacy pass manager, as well as the unstable `-Znew-llvm-pass-manager` option. We have been defaulting to the new PM since LLVM 13 (except for s390x that waited for 14), and LLVM 15 removed support altogether. The only place we still use the legacy PM is for writing the output file, just like `llc` does. cc #74705 r? ``@nikic``
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-3/+2
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-15/+15
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-15/+15
2022-09-18Remove -Znew-llvm-pass-managerJosh Stone-1/+0
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-12change rlib format to discern native dependenciesDaniil Belov-0/+1
2022-09-07Auto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoeristerbors-3/+14
Track PGO profiles in depinfo This PR makes sure that PGO profiles (`-Cprofile-use` and `-Cprofile-sample-use`) are tracked in depinfo, so that when they change, the compilation session will be invalidated. This approach was discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Tracking.20PGO.20profile.20files.20in.20cargo). I tried it locally and it seems that the code is recompiled just with this change, and https://github.com/rust-lang/rust/pull/100413 is not even needed. But it's possible that not everything required is recompiled, so we will probably want to land both changes. Another approach to implement this could be to store the PGO profiles in `sess.parse_sess.file_depinfo` when the session is being created, but then the paths would have to be converted to a string and then to a symbol, which seemed unnecessarily complicated. CC `@michaelwoerister` r? `@Eh2406`
2022-09-05Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwcoDylan DPC-2/+2
Improve HIR stats #100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2022-09-02Rollup merge of #100552 - petrochenkov:flavorcompat, r=lqdGuillaume Gomez-5/+3
rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors I want to do some refactorings in `rustc_target` - merge `lld_flavor` and `linker_is_gnu` into `linker_flavor`, support combination gcc+lld (https://github.com/rust-lang/rust/pull/96827). This PR adds some compatibility infra that makes that possible without making any changes to user-facing interfaces - `-Clinker-flavor` values and json target specs. (For json target specs this infra may eventually go away since they are not very stable.) The second commit does some light refactoring of internal linker flavors (applies changes from https://github.com/petrochenkov/rust/commit/53eca42973b7e379b9fa0469c33f08680b57c35f that don't require mass-editing target specs).
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-6/+8
by module
2022-09-01rustc_target: Refactor internal linker flavors slightlyVadim Petrochenkov-5/+3
Remove one unstable user-facing linker flavor (l4-bender)
2022-08-31Fix a bunch of typoDezhi Wu-2/+2
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-29Track PGO profiles in depinfoJakub Beránek-3/+14
2022-08-29Add prefix to every line of `-Zhir-stats` output.Nicholas Nethercote-2/+2
This is based on `-Zprint-type-sizes` which does the same thing. It makes the output provenance clearer, and helps with post-processing. E.g. if you have `-Zhir-stats` output from numerous compiler invocations you can now easily extract the pre-expansion stats separately from the post-expansion stats.
2022-08-25Rollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, ↵Yuki Okushi-62/+119
r=davidtwco Migrate `rustc_interface` diagnostics ``@rustbot`` label +A-translation r? rust-lang/diagnostics cc #100717
2022-08-23Use par_body_owners for livenessSeo Sanghyeon-3/+3
2022-08-22Remove use of DiagnosticArgFromDisplayGiacomo Stevanato-30/+22
2022-08-22Deny diagnostic lints in rustc_interfaceGiacomo Stevanato-0/+2
2022-08-22Move rustc_interface diagnostics to struct SessionDiagnostic derivesGiacomo Stevanato-40/+100
2022-08-22Move existing diagnostic struct to a new errors moduleGiacomo Stevanato-19/+22
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-2/+2
2022-08-17Migrate emoji identifier diagnostics to `SessionDiagnostic`finalchild-18/+22
2022-08-12Adjust cfgsMark Rousskov-3/+3
2022-07-31Rollup merge of #99519 - Urgau:check-cfg-implicit, r=petrochenkovMatthias Krüger-1/+0
Remove implicit names and values from `--cfg` in `--check-cfg` This PR remove the implicit names and values from `--cfg` in `--check-cfg` because the behavior is quite surprising but also because it's really easy to inadvertently really on the implicitness and when the `--cfg` is not set anymore to have an unexpected warning from an unexpected condition that pass with the implicitness. This change in behavior will also enable us to warn when an unexpected `--cfg` is passed, ex: the user wrote `--cfg=unstabl` instead of `--cfg=unstable`. The implementation of the warning will be done in a follow-up PR. cc `@petrochenkov`
2022-07-29proc_macro: use crossbeam channels for the proc_macro cross-thread bridgeNika Layzell-1/+2
This is done by having the crossbeam dependency inserted into the proc_macro server code from the server side, to avoid adding a dependency to proc_macro. In addition, this introduces a -Z command-line option which will switch rustc to run proc-macros using this cross-thread executor. With the changes to the bridge in #98186, #98187, #98188 and #98189, the performance of the executor should be much closer to same-thread execution. In local testing, the crossbeam executor was substantially more performant than either of the two existing CrossThread strategies, so they have been removed to keep things simple.