Sema: add support for `__attribute__((__swift_newtype__))`
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 11 Sep 2020 20:35:04 +0000 (20:35 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 24 Sep 2020 15:17:35 +0000 (15:17 +0000)
commit296d8832a3b5fe97725be62c5bbc721cc0e2cd20
treed8da86ed1c39a3294c3a48c2269b5acea9530269
parent31a3c5fb45b78bdaa78d94ffcc9258e839002016
Sema: add support for `__attribute__((__swift_newtype__))`

Add the `swift_newtype` attribute which allows a type definition to be
imported into Swift as a new type.  The imported type must be either an
enumerated type (enum) or an object type (struct).

This is based on the work of the original changes in
https://github.com/llvm/llvm-project-staging/commit/8afaf3aad2af43cfedca7a24cd817848c4e95c0c

Differential Revision: https://reviews.llvm.org/D87652
Reviewed By: Aaron Ballman
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/AST/attr-swift_newtype.m [new file with mode: 0644]
clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/SemaObjC/attr-swift_newtype.m [new file with mode: 0644]