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 2 times, most recently from 866ac85 to 56f6ce2 Compare October 10, 2025 21:59
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 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
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