Skip to content

Three LLVM-type-related cleanups - #166034

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
beetrees:llvm-type-cleanup
Nov 16, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
beetrees:llvm-type-cleanup

Conversation

@beetrees

Copy link
Copy Markdown
Contributor

This PR contains three small LLVM-type-related cleanups, each in a separate commit:

  • All but one users of type_named_struct immediately call set_struct_body to set the struct fields. The first commit refactors type_named_struct to set the fields itself.
  • Several places in rustc_codegen_llvm call the generic type_ix/const_uint/const_int methods with a constant type; the second commit changes these cases to use the more concise type-specific methods.
  • isize_ty is only called by type_isize, so the third commit inlines it.

r? @bjorn3

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 16, 2026
@bjorn3

bjorn3 commented Nov 16, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 61f6e0d has been approved by bjorn3

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 16, 2026
Three LLVM-type-related cleanups

This PR contains three small LLVM-type-related cleanups, each in a separate commit:

* All but one users of `type_named_struct` immediately call `set_struct_body` to set the struct fields. The first commit refactors `type_named_struct` to set the fields itself.
* Several places in `rustc_codegen_llvm` call the generic `type_ix`/`const_uint`/`const_int` methods with a constant type; the second commit changes these cases to use the more concise type-specific methods.
* `isize_ty` is only called by `type_isize`, so the third commit inlines it.

r? @bjorn3
rust-bors Bot pushed a commit that referenced this pull request Nov 16, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #166011 (Clean revert of recent `String::retain` changes)
 - #165475 (Add a `!type` annotation to a vtable for every supertrait that is a prefix of the vtable)
 - #165881 (fix MSVC calling convention byte counts)
 - #165882 (Add a separate feature gate for EIIs with default impls)
 - #165922 (Prevent inlining of foreign items through glob reexports named `_`)
 - #165979 (Improve index inference diagnostics)
 - #165983 (Update `minifier-rs` dependency version to `0.5.0`)
 - #165613 (Handle trait default values in `mir_for_direct_const`)
 - #165677 (Rewrite relaxed bound policy code)
 - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
 - #165990 (gca fixed issue regression tests)
 - #165993 (pipe_subprocess test: use libtest harness)
 - #165998 (Cleanup borrowck)
 - #166005 (add ABI compat checks for new float types)
 - #166009 (Improve `String::insert{,_str}` safety comments)
 - #166021 (Correct and expand E0225 error explanation.)
 - #166029 (rustc-dev-guide subtree update)
 - #166031 (Split packed structs out of `const_struct`)
 - #166032 (Normalize the simd field type before reading its length)
 - #166034 (Three LLVM-type-related cleanups)
 - #166047 (Document AltiVec requirement for powerpc64-unknown-linux-gnuelfv2)
@nikic

nikic commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

If you feel like it, it should be possible to remove the remaining use of type_named_struct_deferred as well, and the defer mechanism in that code in general. That looks like a pre-opaque-pointers leftover.

@rust-bors
rust-bors Bot merged commit cd6be56 into rust-lang:main Nov 16, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 16, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 16, 2026
Rollup merge of #166034 - beetrees:llvm-type-cleanup, r=bjorn3

Three LLVM-type-related cleanups

This PR contains three small LLVM-type-related cleanups, each in a separate commit:

* All but one users of `type_named_struct` immediately call `set_struct_body` to set the struct fields. The first commit refactors `type_named_struct` to set the fields itself.
* Several places in `rustc_codegen_llvm` call the generic `type_ix`/`const_uint`/`const_int` methods with a constant type; the second commit changes these cases to use the more concise type-specific methods.
* `isize_ty` is only called by `type_isize`, so the third commit inlines it.

r? @bjorn3
@beetrees
beetrees deleted the llvm-type-cleanup branch November 16, 2026 19:15
sushink70 pushed a commit to sushink70/miri that referenced this pull request Nov 17, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - rust-lang/rust#166011 (Clean revert of recent `String::retain` changes)
 - rust-lang/rust#165475 (Add a `!type` annotation to a vtable for every supertrait that is a prefix of the vtable)
 - rust-lang/rust#165881 (fix MSVC calling convention byte counts)
 - rust-lang/rust#165882 (Add a separate feature gate for EIIs with default impls)
 - rust-lang/rust#165922 (Prevent inlining of foreign items through glob reexports named `_`)
 - rust-lang/rust#165979 (Improve index inference diagnostics)
 - rust-lang/rust#165983 (Update `minifier-rs` dependency version to `0.5.0`)
 - rust-lang/rust#165613 (Handle trait default values in `mir_for_direct_const`)
 - rust-lang/rust#165677 (Rewrite relaxed bound policy code)
 - rust-lang/rust#165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes)
 - rust-lang/rust#165990 (gca fixed issue regression tests)
 - rust-lang/rust#165993 (pipe_subprocess test: use libtest harness)
 - rust-lang/rust#165998 (Cleanup borrowck)
 - rust-lang/rust#166005 (add ABI compat checks for new float types)
 - rust-lang/rust#166009 (Improve `String::insert{,_str}` safety comments)
 - rust-lang/rust#166021 (Correct and expand E0225 error explanation.)
 - rust-lang/rust#166029 (rustc-dev-guide subtree update)
 - rust-lang/rust#166031 (Split packed structs out of `const_struct`)
 - rust-lang/rust#166032 (Normalize the simd field type before reading its length)
 - rust-lang/rust#166034 (Three LLVM-type-related cleanups)
 - rust-lang/rust#166047 (Document AltiVec requirement for powerpc64-unknown-linux-gnuelfv2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants