Skip to content

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Sep 19, 2025

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...

@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 Sep 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 19, 2025

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@bors
Copy link
Collaborator

bors commented Sep 24, 2025

☔ The latest upstream changes (presumably #146338) made this pull request unmergeable. Please resolve the merge conflicts.

Use llfn_attrs_from_instance() to generate the attributes for the
allocator shim. This ensures that we generate all the usual
attributes (and don't get to find out one-by-one that a certain
attribute is important for a certain target). Additionally this
will enable emitting the allocator-specific attributes (not
included here).

This change is quite awkward because the allocator shim uses
SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've
switched it to use SimpleCx plus tcx/sess arguments where necessary.
If there's a simpler way to do this, I'd love to know about it...
@nikic nikic force-pushed the allocator-shim-attributes branch from 2f5cb60 to d226e7a Compare September 25, 2025 08:13
@rustbot
Copy link
Collaborator

rustbot commented Sep 25, 2025

This PR was rebased onto a different master 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.

@jackh726
Copy link
Member

Seems reasonable enough to me, mostly a mechanical change. Certainly better to reuse existing logic.

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

📌 Commit d226e7a has been approved by jackh726

It is now in the queue for this repository.

@bors bors 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 Sep 26, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…=jackh726

Use standard attribute logic for allocator shim

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 7 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146778 (Use standard attribute logic for allocator shim)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…=jackh726

Use standard attribute logic for allocator shim

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…=jackh726

Use standard attribute logic for allocator shim

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
bors added a commit that referenced this pull request Sep 26, 2025
Rollup of 10 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146704 (port `#[debugger_visualizer]` to the new attribute system)
 - #146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - #146778 (Use standard attribute logic for allocator shim)
 - #146849 (Reduce some uses of `LegacyBang`)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 27, 2025
Rollup of 10 pull requests

Successful merges:

 - #145113 (resolve: Do not finalize shadowed bindings)
 - #146523 (Demote both armebv7r-none-* targets.)
 - #146704 (port `#[debugger_visualizer]` to the new attribute system)
 - #146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - #146778 (Use standard attribute logic for allocator shim)
 - #146849 (Reduce some uses of `LegacyBang`)
 - #147016 (fix doc comments to be more standard)
 - #147027 (Add new `tyalias` intra-doc link disambiguator)
 - #147031 (mbe: Simplify check_redundant_vis_repetition)
 - #147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - #147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 35f443d into rust-lang:master Sep 27, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 27, 2025
rust-timer added a commit that referenced this pull request Sep 27, 2025
Rollup merge of #146778 - nikic:allocator-shim-attributes, r=jackh726

Use standard attribute logic for allocator shim

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Sep 29, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145113 (resolve: Do not finalize shadowed bindings)
 - rust-lang/rust#146523 (Demote both armebv7r-none-* targets.)
 - rust-lang/rust#146704 (port `#[debugger_visualizer]` to the new attribute system)
 - rust-lang/rust#146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - rust-lang/rust#146778 (Use standard attribute logic for allocator shim)
 - rust-lang/rust#146849 (Reduce some uses of `LegacyBang`)
 - rust-lang/rust#147016 (fix doc comments to be more standard)
 - rust-lang/rust#147027 (Add new `tyalias` intra-doc link disambiguator)
 - rust-lang/rust#147031 (mbe: Simplify check_redundant_vis_repetition)
 - rust-lang/rust#147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
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