Skip to content

ClangImporter attributes should follow the Swift attribute grammar #84486

@susmonteiro

Description

@susmonteiro

The SWIFT_COPYABLE_IF macro expands to

#define SWIFT_COPYABLE_IF(...) \
  __attribute__((swift_attr("copyable_if:" _CXX_INTEROP_CONCAT(__VA_ARGS__))))

which requires a custom parser. If it followed the Swift attribute grammar, e.g. swift_attr("Copyable(if: " _CXX_INTEROP_CONCAT(__VA_ARGS__) ")" ), the standard Swift attribute parser would be able to parse it.

We should rewrite these existing attributes to follow the Swift attribute grammar, which will reduce complexity in the ClangImporter.

Metadata

Metadata

Assignees

Labels

c++ interopFeature: Interoperability with C++

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions