[PATCH] D87395: Sema: add support for `__attribute__((__swift_objc_members__))`

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 13:31:35 PDT 2020


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/AttrDocs.td:3387
+The ``swift_objc_members`` attribute maps to the ``@objcMembers`` Swift
+attribute, which indicates that Swift members of this class, its subclasses, and
+all extensions thereof, will implicitly be exposed back to Objective-C.
----------------
gribozavr2 wrote:
> aaron.ballman wrote:
> > gribozavr2 wrote:
> > > aaron.ballman wrote:
> > > > The documentation is a bit hard to follow -- the user is going to be adding this attribute to an ObjC interface, so the docs should be talking about what that means from the ObjC side of things more so than the Swift side, no?
> > > IIUC, this attribute has no effect on the Objective-C users of this type.
> > It may not have semantic impact on the ObjC side of things, but I'd still expect that since the user is writing it on an ObjC entity, the docs talk about it from that perspective. 
> > 
> > e.g., I'd expect the documentation to be more along the lines of "The attribute indicates that the members of this Objective-C class/protocol/whatever, its subclasses and so on, will be exposed as Swift class members that do the awesome thing." instead of "In Swift, this other attribute does things similar to what this one does in Objective-C."
> Sure, how about this: "This attribute indicates that Swift subclasses and members of Swift extensions of this class will be implicitly marked with the ``@objcMembers`` Swift attribute."
> 
> (This attribute has no effect on this class itself or its members, even when imported in Swift -- only on Swift extensions & subclasses.)
That sounds better to me, thank you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87395/new/

https://reviews.llvm.org/D87395



More information about the cfe-commits mailing list