[ObjC] Handle objc_{retain,release}_xYY when removing reference counting calls - #8535
Merged
Conversation
bdash
requested review from
emesare
and
a lite review from Copilot
and removed request for
Copilot
September 9, 2026 14:40
emesare
approved these changes
Sep 9, 2026
emesare
left a comment
Member
There was a problem hiding this comment.
lgtm, small comment about potentially making the "get arch register from var" pattern a helper
| .contents | ||
| .first() | ||
| .filter(|var| var.ty == VariableSourceType::RegisterVariableSourceType) | ||
| .and_then(|var| arch.register_from_id(RegisterId::from(var.storage as u32)))?; |
Member
There was a problem hiding this comment.
For later we should add some helper to make this pattern of getting the backing register from a variable easier. Not apart of this PR.
bdash
force-pushed
the
test_objc_remove_retain_xN
branch
from
September 10, 2026 04:44
a75706c to
f2f29d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are slightly tricky as
objc_retain_xNtakes its argument inxNand returns it inx0. This means it cannot simply be replaced with anoplike we do withobjc_retain. It is instead replaced with an assignment.