Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and...
authorBen Hamilton <benhamilton@google.com>
Mon, 22 Jul 2019 18:20:01 +0000 (18:20 +0000)
committerBen Hamilton <benhamilton@google.com>
Mon, 22 Jul 2019 18:20:01 +0000 (18:20 +0000)
commitd9212ef77b927f634b43f30289e75fa3f16df3f0
tree6f58bec8d0e2d50aae6f84b23d24fe6ac5e6e607
parent4138b2f16760f2b0be4008d68284dc1f97dbd5bd
Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM.

Summary:
Addresses the formatting of NS_CLOSED_ENUM and CF_CLOSED_ENUM, introduced in Swift 5.

Before:

```
typedef NS_CLOSED_ENUM(NSInteger, Foo){FooValueOne = 1, FooValueTwo,
                                       FooValueThree};
```

After:

```
typedef NS_CLOSED_ENUM(NSInteger, Foo) {
  FooValueOne = 1,
  FooValueTwo,
  FooValueThree
};
```

Contributed by heijink.

Reviewers: benhamilton, krasimir

Reviewed By: benhamilton

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D65012

llvm-svn: 366719
clang/lib/Format/Format.cpp
clang/lib/Format/FormatToken.h
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/FormatTestObjC.cpp