about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-07-31allow `DebuginfoLevel` to be comparedRémy Rakic-1/+1
2023-07-31strip debuginfo from LLVM's .so when applicable, on x64 linuxRémy Rakic-0/+26
2023-07-31extract helper to find libLLVM's nameRémy Rakic-8/+13
2023-07-31Auto merge of #113879 - nnethercote:codegen_ssa-cleanups, r=bjorn3bors-199/+200
`codegen_ssa` cleanups Some clarifications I made when reading this code closely. r? `@tmiasko`
2023-07-31Remove unnecessary semicolon.Nicholas Nethercote-1/+1
2023-07-31Auto merge of #114225 - workingjubilee:only-golden-arches, r=compiler-errorsbors-184/+75
Only golden arches A number of tests in the test suite have applied the somewhat comedic practice of ignoring *every* single target architecture that rustc has ever supported. This is silly, when they are clearly tests built around certain assumptions, primarily of the x86-64 architecture, or in one case when they are only relevant for a handful of 32-bit targets. This has even resulted, in one case, in the same architecture being ignored twice! Document these better, and use a "revision + only-arch" idiom in the test headers to denote the "golden arches" that actually pass these tests.
2023-07-31Clean up `generate_lto_work`.Nicholas Nethercote-22/+23
This function has some shared code for the thin LTO and fat LTO cases, but those cases have so little in common that it's actually clearer to treat them fully separately.
2023-07-31Fix LLVM thread names on Windows.Nicholas Nethercote-3/+3
PR #112946 tweaked the naming of LLVM threads, but messed things up slightly, resulting in threads on Windows having names like `optimize module {} regex.f10ba03eb5ec7975-cgu.0`. This commit removes the extraneous `{} `.
2023-07-31Introduce `running_with_any_token` closure.Nicholas Nethercote-7/+10
It makes things a little clearer.
2023-07-31Use standard Rust capitalization rules for names containing "LTO".Nicholas Nethercote-22/+22
2023-07-31Tweak structure of the message loop.Nicholas Nethercote-17/+20
The main loop has a *very* complex condition, which includes two mentions of `codegen_state`. The body of the loop then immediately switches on the `codegen_state`. I find it easier to understand if it's a `loop` and we check for exit conditions after switching on `codegen_state`. We end up with a tiny bit of code duplication, but it's clear that (a) we never exit in the `Ongoing` case, (b) we exit in the `Completed` state only if several things are true (and there's interaction with LTO there), and (c) we exit in the `Aborted` state if a couple of things are true. Also, the exit conditions are all simple conjunctions.
2023-07-31Tweak a loop condition.Nicholas Nethercote-7/+11
This loop condition involves `codegen_state`, `work_items`, and `running_with_own_token`. But the body of the loop cannot modify `codegen_state`, so repeatedly checking it is unnecessary.
2023-07-31Move `maybe_start_llvm_timer`'s body into `spawn_work`.Nicholas Nethercote-26/+18
The two functions are alway called together. This commit factors out the repeated code.
2023-07-31Remove `CodegenContext::worker`.Nicholas Nethercote-24/+12
`CodegenContext` is immutable except for the `worker` field - we clone `CodegenContext` in multiple places, changing the `worker` field each time. It's simpler to move the `worker` field out of `CodegenContext`.
2023-07-31Document `-Zno-parallel-llvm`.Nicholas Nethercote-0/+8
Because it's usefulness wasn't clear to me, and I initially wondered if it could be removed. The text is based on the text in #50972, the PR that added the flag.
2023-07-31Fix a comment.Nicholas Nethercote-0/+1
Make it match the corresponding comment at the start of the unstable options.
2023-07-31Remove `ExtraBackendMethods::spawn_thread`.Nicholas Nethercote-21/+0
It's no longer used, and `spawn_named_thread` is preferable, because naming threads is helpful when profiling.
2023-07-31Give the coordinator thread a name.Nicholas Nethercote-3/+4
This is useful when profiling with a profiler like Samply.
2023-07-31Remove some unused values in `codegen_crate`.Nicholas Nethercote-3/+0
2023-07-31Remove an unnecessary `pub`.Nicholas Nethercote-1/+1
2023-07-31Rename `MainThreadWorkerState`.Nicholas Nethercote-25/+25
The `Worker` is unnecessary, and just makes it longer than necessary.
2023-07-31Rename things related to the main thread's operations.Nicholas Nethercote-30/+46
It took me some time to understand how the main thread can lend a jobserver token to an LLVM thread. This commit renames a couple of things to make it clearer. - Rename the `LLVMing` variant as `Lending`, because that is a clearer description of what is happening. - Rename `running` as `running_with_own_token`, which makes it clearer that there might be one additional LLVM thread running (with a loaned token). Also add a comment to its definition.
2023-07-31Add some assertions.Nicholas Nethercote-0/+4
- Thin and fat LTO can't happen together. - `NeedsLink` and (non-allocator) `Compiled` work item results can't happen together.
2023-07-31Add comments to `WorkItemResult`.Nicholas Nethercote-4/+14
And rename the `Compiled` variant as `Finished`, because that name makes it clearer there is nothing left to do, contrasting nicely with the `Needs*` variants.
2023-07-31Inline and remove `submit_pre_codegened_module_to_llvm`.Nicholas Nethercote-15/+9
It has a single callsite, and provides little value.
2023-07-31Auto merge of #114266 - calebzulawski:simd-bswap, r=compiler-errorsbors-11/+32
Fix simd_bswap for i8/u8 #114156 missed this test case ☹️ cc `@workingjubilee`
2023-07-31Auto merge of #114272 - workingjubilee:rollup-ll9lwon, r=workingjubileebors-61/+59
Rollup of 4 pull requests Successful merges: - #95965 (Stabilize const-weak-new) - #109075 (Use `LazyLock` to lazily resolve backtraces) - #113741 (Don't install default projection bound for return-position `impl Trait` in trait methods with no body) - #114268 (Fix empty_write since rust version attribute) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-30Rollup merge of #114268 - SUPERCILEX:empty, r=workingjubileeJubilee-2/+2
Fix empty_write since rust version attribute Fixup of https://github.com/rust-lang/rust/pull/98154 for the rust version. r? ``@workingjubilee``
2023-07-30Rollup merge of #113741 - compiler-errors:rpitit-projects-to-missing-opaque, ↵Jubilee-8/+30
r=spastorino Don't install default projection bound for return-position `impl Trait` in trait methods with no body This ensures that we never try to project to an opaque type in a trait method that has no body to infer its hidden type, which means we never later call `type_of` on that opaque. This is because opaque types try to reveal their hidden type when proving auto traits. I thought about this a lot, and I think this is a fix that's less likely to introduce other strange downstream ICEs than #113461. Fixes #113434 r? `@spastorino`
2023-07-30Rollup merge of #109075 - joboet:lazylock_backtrace, r=workingjubileeJubilee-49/+25
Use `LazyLock` to lazily resolve backtraces By using TAIT to name the initializing closure, `LazyLock` can be used to replace the current `LazilyResolvedCapture`.
2023-07-30Rollup merge of #95965 - CAD97:const-weak-new, r=workingjubileeJubilee-2/+2
Stabilize const-weak-new This is a fairly uncontroversial library stabilization, so I'm going ahead and proposing it to ride the trains to stable. This stabilizes the following APIs, which are defined to be non-allocating constructors. ```rust // alloc::rc impl<T> Weak<T> { pub const fn new() -> Weak<T>; } // alloc::sync impl<T> Weak<T> { pub const fn new() -> Weak<T>; } ``` Closes #95091 ``@rustbot`` modify labels: +needs-fcp
2023-07-31Auto merge of #114126 - ozkanonur:stage-support-for-clean, r=ozkanonurbors-31/+75
clean stage-specific artifacts using `x clean --stage` fixes #109313
2023-07-30Stabilize const-weak-newCAD97-2/+2
Bump its stabilization version several times along the way to accommodate changes in release processes. Co-authored-by: Mara Bos <m-ou.se@m-ou.se> Co-authored-by: Trevor Gross <t.gross35@gmail.com>
2023-07-30Auto merge of #112843 - chenyukang:yukang-more-on-backtrace, r=workingjubileebors-8/+35
Print omitted frames count for short backtrace mode Fixes #111730
2023-07-30Fix empty_write since rust version attributeAlex Saveau-2/+2
2023-07-30Don't install default projection bound for RPITITsMichael Goulet-8/+30
2023-07-30remove stage-specific artifacts when `--stage` is usedozkanonur-22/+62
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-07-30support `--stage` for `x clean`ozkanonur-9/+13
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-07-30Auto merge of #114264 - matthiaskrgr:rollup-dfsuu1v, r=matthiaskrgrbors-560/+614
Rollup of 6 pull requests Successful merges: - #98154 (merge functionality of `io::Sink` into `io::Empty`) - #102198 (`const`-stablilize `NonNull::as_ref`) - #114074 (inline format!() args from rustc_middle up to and including rustc_codegen_llvm (3)) - #114246 (Weaken unnameable_types lint) - #114256 (Fix invalid suggestion for mismatched types in closure arguments) - #114258 (Simplify `Span::can_be_used_for_suggestions` a little tiny bit) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-30Fix simd_bswap for i8/u8Caleb Zulawski-11/+32
2023-07-30Rollup merge of #114258 - WaffleLapkin:reuse_in_derive_expansion, r=petrochenkovMatthias Krüger-1/+1
Simplify `Span::can_be_used_for_suggestions` a little tiny bit Just something I saw randomly.
2023-07-30Rollup merge of #114256 - Urgau:fix-issue-114180, r=WaffleLapkinMatthias Krüger-30/+78
Fix invalid suggestion for mismatched types in closure arguments This PR fixes the invalid suggestion for mismatched types in closure arguments. The invalid suggestion came from a wrongly created span in the parser for closure arguments that don't have a type specified. Specifically, the span in this case was the last token span, but in the case of tuples, the span represented the last parenthesis instead of the whole tuple, which is fixed by taking the more accurate span of the pattern. There is one unfortunate downside of this fix, it worsens even more the diagnostic for mismatched types in closure args without an explicit type. This happens because there is no correct span for implied inferred type. I tried also fixing this but it's a rabbit hole. Fixes https://github.com/rust-lang/rust/issues/114180
2023-07-30Rollup merge of #114246 - Bryanskiy:type-privacy-lints-fixes, r=petrochenkovMatthias Krüger-20/+4
Weaken unnameable_types lint `unnameable_types` lint is no longer emitted for - associated types - internal types r? ``@petrochenkov``
2023-07-30Rollup merge of #114074 - matthiaskrgr:fmt_args_rustc_2, r=WaffleLapkinMatthias Krüger-481/+411
inline format!() args from rustc_middle up to and including rustc_codegen_llvm (3) r? `@WaffleLapkin`
2023-07-30Rollup merge of #102198 - lukas-code:nonnull_as_ref, r=AmanieuMatthias Krüger-2/+33
`const`-stablilize `NonNull::as_ref` A bunch of pointer to reference methods have been made unstably const some time ago in #91823 under the feature gate `const_ptr_as_ref`. Out of these, `NonNull::as_ref` can be implemented as a `const fn` in stable rust today, so i hereby propose to const stabilize this function only. Tracking issue: #91822 ``@rustbot`` label +T-libs-api -T-libs
2023-07-30Rollup merge of #98154 - vidhanio:master, r=workingjubileeMatthias Krüger-26/+87
merge functionality of `io::Sink` into `io::Empty` Many times, there is a need for a simple dummy `io::Read`er + `io::Write`r, but currently the only options are `io::Empty` and `io::Sink` respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This PR adds the functionality of `io::Sink` to `io::Empty`, making `io::Empty` be able to perform the tasks of both of the previous structs. (This idea was first mentioned in #24235) Note: I also updated some doc comments in `io::utils` in this pull request to fix inconsistencies between `io::Sink` and `io::Empty`. API Change Proposal: https://github.com/rust-lang/libs-team/issues/49
2023-07-30Auto merge of #114204 - GuillaumeGomez:remove-unneeded-clone-calls, r=notriddlebors-16/+11
[rustdoc] Remove unneeded `clone()` calls for `derive_id` I realized we were cloning values before passing them to `derive_id` where they are cloned again, which isn't great. Since they'll be cloned anyway, let's allow to pass both by reference and by value. r? `@notriddle`
2023-07-31normalize backtrace error messagesyukang-8/+9
2023-07-30Simplify `Span::can_be_used_for_suggestions` a little tiny bitMaybe Waffle-1/+1
2023-07-30Fix invalid suggestion for mismatched types in closure argumentsUrgau-30/+78
The invalid suggestion came from a wrongly created span in `rustc_parse' for closure arguments that didn't have a type specified. Specifically, the span in this case was the last token span, but in the case of tuples, the span represented the last parenthesis instead of the whole tuple, which is fixed by taking the more accurate span of the pattern.