summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorBen Hamilton <benhamilton@google.com>2019-07-22 18:20:01 +0000
committerBen Hamilton <benhamilton@google.com>2019-07-22 18:20:01 +0000
commitd9212ef77b927f634b43f30289e75fa3f16df3f0 (patch)
tree6f58bec8d0e2d50aae6f84b23d24fe6ac5e6e607 /clang/lib/Format/UnwrappedLineParser.cpp
parent4138b2f16760f2b0be4008d68284dc1f97dbd5bd (diff)
downloadbcm5719-llvm-d9212ef77b927f634b43f30289e75fa3f16df3f0.tar.gz
bcm5719-llvm-d9212ef77b927f634b43f30289e75fa3f16df3f0.zip
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
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index a35e98ae550..b9da698a931 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -1215,7 +1215,8 @@ void UnwrappedLineParser::parseStructuralElement() {
case tok::kw_typedef:
nextToken();
if (FormatTok->isOneOf(Keywords.kw_NS_ENUM, Keywords.kw_NS_OPTIONS,
- Keywords.kw_CF_ENUM, Keywords.kw_CF_OPTIONS))
+ Keywords.kw_CF_ENUM, Keywords.kw_CF_OPTIONS,
+ Keywords.kw_CF_CLOSED_ENUM, Keywords.kw_NS_CLOSED_ENUM))
parseEnum();
break;
case tok::kw_struct:
OpenPOWER on IntegriCloud