Skip to content

Conversation

dmaclach
Copy link
Contributor

@dmaclach dmaclach commented Oct 6, 2025

Partial fix for
KT-81447 Native: Objective-C: Excessive 'swift_name' attributes being generated

Removes swift_name attribute from declarations that would already have that swift name. Initially focusing on properties and and simple methods that have no parameters.

The excessive use of swift_attributes creates large headers, and even larger pcm files generated from those headers.

@dmaclach dmaclach requested a review from a team as a code owner October 6, 2025 16:53
@dmaclach dmaclach requested a review from haitaka October 6, 2025 16:53
@dmaclach
Copy link
Contributor Author

dmaclach commented Oct 6, 2025

Please feel free to comment on my kotlin style. It is not my primary language by a long shot.

@sbogolepov sbogolepov removed the request for review from haitaka October 7, 2025 07:15
val privateAttribute: String? = property.getSwiftPrivateAttribute()
if (privateAttribute != null) {
declarationAttributes.add(privateAttribute)
} else if (propertyName.objCName != propertyName.swiftName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this optimization lead to an issue like this: JetBrains/kotlin-native#2571?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. Was unaware of that case. Updated with fix.

@dmaclach dmaclach force-pushed the unneeded_swiftnames branch 3 times, most recently from 56f6ce2 to c04ac24 Compare October 11, 2025 00:50
@dmaclach
Copy link
Contributor Author

Ignore for a moment. Fixing the AA cases.

@sbogolepov sbogolepov requested a review from glukianets October 13, 2025 07:51
Partial fix for
KT-81447 Native: Objective-C: Excessive 'swift_name' attributes being generated

Removes swift_name attribute from declarations that would already have that swift name.
Initially focusing on properties and and simple methods that have no parameters.

The excessive use of swift_attributes creates large headers, and even larger pcm files
generated from those headers.
@dmaclach dmaclach force-pushed the unneeded_swiftnames branch from c04ac24 to 08eccc7 Compare October 13, 2025 23:09
@dmaclach
Copy link
Contributor Author

AA cases all fixed. It's a big change, but not sure how I could really break it up unless you want properties/methods split out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants