From d9212ef77b927f634b43f30289e75fa3f16df3f0 Mon Sep 17 00:00:00 2001 From: Ben Hamilton Date: Mon, 22 Jul 2019 18:20:01 +0000 Subject: 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/FormatToken.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Format/FormatToken.h') diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index df749374202..4acd6371e71 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -677,8 +677,10 @@ struct AdditionalKeywords { kw_override = &IdentTable.get("override"); kw_in = &IdentTable.get("in"); kw_of = &IdentTable.get("of"); + kw_CF_CLOSED_ENUM = &IdentTable.get("CF_CLOSED_ENUM"); kw_CF_ENUM = &IdentTable.get("CF_ENUM"); kw_CF_OPTIONS = &IdentTable.get("CF_OPTIONS"); + kw_NS_CLOSED_ENUM = &IdentTable.get("NS_CLOSED_ENUM"); kw_NS_ENUM = &IdentTable.get("NS_ENUM"); kw_NS_OPTIONS = &IdentTable.get("NS_OPTIONS"); @@ -787,8 +789,10 @@ struct AdditionalKeywords { IdentifierInfo *kw_override; IdentifierInfo *kw_in; IdentifierInfo *kw_of; + IdentifierInfo *kw_CF_CLOSED_ENUM; IdentifierInfo *kw_CF_ENUM; IdentifierInfo *kw_CF_OPTIONS; + IdentifierInfo *kw_NS_CLOSED_ENUM; IdentifierInfo *kw_NS_ENUM; IdentifierInfo *kw_NS_OPTIONS; IdentifierInfo *kw___except; -- cgit v1.2.3