Skip to content

[ObjC] Handle objc_{retain,release}_xYY when removing reference counting calls - #8535

Merged
bdash merged 1 commit into
devfrom
test_objc_remove_retain_xN
Sep 10, 2026
Merged

[ObjC] Handle objc_{retain,release}_xYY when removing reference counting calls#8535
bdash merged 1 commit into
devfrom
test_objc_remove_retain_xN

Conversation

@bdash

@bdash bdash commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

These are slightly tricky as objc_retain_xN takes its argument in xN and returns it in x0. This means it cannot simply be replaced with a nop like we do with objc_retain. It is instead replaced with an assignment.

@bdash
bdash requested review from emesare and a lite review from Copilot and removed request for Copilot September 9, 2026 14:40

@emesare emesare left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)))?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
bdash force-pushed the test_objc_remove_retain_xN branch from a75706c to f2f29d9 Compare September 10, 2026 04:44
@bdash
bdash merged commit f2f29d9 into dev Sep 10, 2026
5 of 6 checks passed
@bdash
bdash deleted the test_objc_remove_retain_xN branch September 10, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants