Skip to content

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Sep 24, 2025

We don't need to print @c @implementation functions in swiftinterfaces as clients should only see the original declaration in the C header. Ensure we don't print @c @implementation and @objc @implementation functions, but still print simple @c and @objc functions.

We don't need to print the `@c @implementation` functions in
swiftinterfaces as clients need only to see the original declaration in
the C header. Don't print `@objc @implementation` functions either, but
still print simple `@c` and `@objc` functions.
@xymus
Copy link
Contributor Author

xymus commented Sep 24, 2025

@swift-ci Please smoke test


// Skip @c @implementation functions along with the attribute.
if (auto AFD = dyn_cast<AbstractFunctionDecl>(D)) {
if (options.excludeAttrKind(DeclAttrKind::ObjCImplementation) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess DeclAttrKind::ObjCImplementation represents @implementation right? This code makes more sense when you realize that but it feels like ObjCImplementation and isObjCImplementation() should maybe be renamed now that they are not Obj-C specific. Is that planned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, that's the @implementation attribute. This wasn't exactly in the plans but I'll see what I can do along with this feature becoming official.

@xymus
Copy link
Contributor Author

xymus commented Sep 26, 2025

@swift-ci Please smoke test Windows

@xymus xymus merged commit 4c7a313 into swiftlang:main Sep 26, 2025
3 checks passed
@xymus xymus deleted the c-impl-in-swiftinterfaces branch September 26, 2025 23:09
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