The swift_attr attribute is a generic annotation attribute that's not used by clang, but is used by the Swift compiler. The Swift compiler can use these annotations to provide various syntactic and semantic sugars for the imported Objective-C API declarations.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Do we need to add APINotes support for this?
clang/include/clang/Basic/Attr.td | ||
---|---|---|
2155 | Should we limit this to appear on certain subjects? Presumably the swift importer is only going to look for this in certain places, so I think it makes sense to call out places where it'll be ignored in clang. WDYT? |
clang/include/clang/Basic/Attr.td | ||
---|---|---|
2153 | The other swift attributes use a GNU spelling and don't expose any C++ spelling. Should this follow suit (or should the other attributes be updated)? | |
clang/include/clang/Basic/AttrDocs.td | ||
3635 | What declarations does this attribute appertain to? | |
3637 | clang -> Clang |
Thanks for taking a look.
Not at the moment, maybe in the future
clang/include/clang/Basic/Attr.td | ||
---|---|---|
2153 | You're right, that was my mistake. Changed it to GNU. | |
2155 | I think we want to leave it as a flexible attribute that can be applied to any declaration for now, and let the Swift importer decide on which declarations it wants to support them. | |
clang/include/clang/Basic/AttrDocs.td | ||
3635 | Mentioned that it can be applied to any declaration. |
The other swift attributes use a GNU spelling and don't expose any C++ spelling. Should this follow suit (or should the other attributes be updated)?