Repository navigation
small cleanups in rustc_codegen_llvm - #165622
Conversation
|
Some changes occurred in compiler/rustc_codegen_llvm/src/debuginfo cc @Walnut356 Some changes occurred in compiler/rustc_codegen_llvm/src/builder/autodiff.rs cc @ZuseZ4 Some changes occurred in coverage instrumentation. cc @Zalathar |
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
This is a large number of individual changes mixed together (despite the modest line count), some of which are more contentious than others, which makes reviewing this a bit of a slog. I'd suggest separating the different kinds of changes into separate commits, to make it easier to check that each kind of change looks good. |
| let value_words = [value as u64, (value >> 64) as u64]; | ||
| let size_in_bits = size.bits(); | ||
| // LLVM computes `NumWords = (SizeInBits + 63) / 64`. | ||
| assert!((size_in_bits + 63) / 64 <= value_words.len() as u64); |
There was a problem hiding this comment.
This assertion is deliberately written to match the LLVM computation, and should not be changed, since the change makes it harder to verify that both sides are performing the same computation.
| feature_err( | ||
| self.sess(), | ||
| feature, | ||
| span, | ||
| "C-variadic function definitions on this target are unstable", | ||
| ) | ||
| .emit(); |
There was a problem hiding this comment.
This seems worse than the status quo, as the call is now spread across several lines without an increase in clarity. I would at least retain msg as a local variable to make the call more compact.
| // Set up the small-data optimization limit for architectures that use | ||
| // an LLVM argument to control this. | ||
| if let (Some(threshold), SmallDataThresholdSupport::LlvmArg(arg)) = ( |
There was a problem hiding this comment.
If we're bothering to clean up this match, then IMO it should become an if-let chain rather than an odd if-let on a tuple.
| pub(crate) fn set_struct_body(&self, ty: &'ll Type, els: &[&'ll Type]) { | ||
| unsafe { llvm::LLVMStructSetBody(ty, els.as_ptr(), els.len() as c_uint, FALSE) } | ||
| } | ||
|
|
||
| pub(crate) fn set_packed_struct_body(&self, ty: &'ll Type, els: &[&'ll Type]) { | ||
| unsafe { llvm::LLVMStructSetBody(ty, els.as_ptr(), els.len() as c_uint, TRUE) } | ||
| } | ||
|
|
There was a problem hiding this comment.
This is the sort of change that should be presented in its own commit at least, not bundled in with dozens of trivial changes.
23fa2fa to
c4fab04
Compare
|
These commits modify compiler targets. Some changes occurred in GUI tests. This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @lolbinarycat Some changes occurred in src/tools/compiletest cc @jieyouxu Some changes occurred in src/tools/cargo cc @weihanglo |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
oh no, i messed up a rebase. let me fix it |
c4fab04 to
04cc725
Compare
This comment has been minimized.
This comment has been minimized.
|
Sorry to everyone who got pinged 😅 I should've split these up into commit from the start. |
This comment has been minimized.
This comment has been minimized.
04cc725 to
6fa07e2
Compare
This comment has been minimized.
This comment has been minimized.
3ba6ed9 to
52e0f08
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
52e0f08 to
7dc2ea1
Compare
|
Looks good, thanks. Good job on squashing the fixups into their original commits. @bors r+ rollup |
…alathar small cleanups in rustc_codegen_llvm small clippy cleanups
Rollup of 13 pull requests Successful merges: - #164707 (Re-enable rustc profile generation for static linked llvm on Windows x64 builds ) - #165068 (Change color usage for highlights) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) Failed merges: - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
…alathar small cleanups in rustc_codegen_llvm small clippy cleanups
Rollup of 11 pull requests Successful merges: - #165068 (Change color usage for highlights) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) Failed merges: - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
|
@bors try jobs=test-various |
small cleanups in rustc_codegen_llvm try-job: test-various
This comment has been minimized.
This comment has been minimized.
…alathar small cleanups in rustc_codegen_llvm small clippy cleanups
…uwer Rollup of 18 pull requests Successful merges: - #164828 (When suggesting path of renamed crate, use the renamed name) - #164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - #165068 (Change color usage for highlights) - #165221 (Canonicalize more comparison operators) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165745 (Don't ICE when a guard condition is a place of type `!`) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) - #165905 (CI: Use a consistent locale when sorting docker build inputs)
…uwer Rollup of 17 pull requests Successful merges: - #164828 (When suggesting path of renamed crate, use the renamed name) - #164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - #165068 (Change color usage for highlights) - #165221 (Canonicalize more comparison operators) - #165841 (Tell Miri about the alignment handling in the Windows System allocator) - #165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - #165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - #164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - #165565 (view-types: lower view types from HIR) - #165622 (small cleanups in rustc_codegen_llvm) - #165771 (tests: cover MSVC ThinLTO exported symbol preservation) - #165810 (reflection: reflect attributes from adts, fields, and variants) - #165823 (Tweak crate error wording and turn them into fatal errors) - #165849 (More opt-dist improvements) - #165855 (Update `sysinfo` version to `0.40.3`) - #165872 (Some attribute related cleanups) - #165905 (CI: Use a consistent locale when sorting docker build inputs)
Rollup merge of #165622 - malezjaa:cleanup-llvm-codegen, r=Zalathar small cleanups in rustc_codegen_llvm small clippy cleanups
…uwer Rollup of 17 pull requests Successful merges: - rust-lang/rust#164828 (When suggesting path of renamed crate, use the renamed name) - rust-lang/rust#164864 (Avoid hoisting uninitialized reads in EarlyOtherwiseBranch) - rust-lang/rust#165068 (Change color usage for highlights) - rust-lang/rust#165221 (Canonicalize more comparison operators) - rust-lang/rust#165841 (Tell Miri about the alignment handling in the Windows System allocator) - rust-lang/rust#165869 (Cleanup: Remove `path_matches` and `value_str` from `AttributeExt`) - rust-lang/rust#165880 (Remove dead code for returning `BackendRepr::Memory` with `PassMode::Direct`) - rust-lang/rust#164108 (Add unstable `-Zllvm-tpde` flag to `rustc_codegen_llvm`) - rust-lang/rust#165565 (view-types: lower view types from HIR) - rust-lang/rust#165622 (small cleanups in rustc_codegen_llvm) - rust-lang/rust#165771 (tests: cover MSVC ThinLTO exported symbol preservation) - rust-lang/rust#165810 (reflection: reflect attributes from adts, fields, and variants) - rust-lang/rust#165823 (Tweak crate error wording and turn them into fatal errors) - rust-lang/rust#165849 (More opt-dist improvements) - rust-lang/rust#165855 (Update `sysinfo` version to `0.40.3`) - rust-lang/rust#165872 (Some attribute related cleanups) - rust-lang/rust#165905 (CI: Use a consistent locale when sorting docker build inputs)
View all comments
small clippy cleanups