diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -964,6 +964,8 @@ LLVMStyle.WhitespaceSensitiveMacros.push_back("STRINGIZE"); LLVMStyle.WhitespaceSensitiveMacros.push_back("PP_STRINGIZE"); LLVMStyle.WhitespaceSensitiveMacros.push_back("BOOST_PP_STRINGIZE"); + LLVMStyle.WhitespaceSensitiveMacros.push_back("NS_SWIFT_NAME"); + LLVMStyle.WhitespaceSensitiveMacros.push_back("CF_SWIFT_NAME"); // Defaults that differ when not C++. if (Language == FormatStyle::LK_TableGen) { diff --git a/clang/unittests/Format/FormatTestObjC.cpp b/clang/unittests/Format/FormatTestObjC.cpp --- a/clang/unittests/Format/FormatTestObjC.cpp +++ b/clang/unittests/Format/FormatTestObjC.cpp @@ -1024,6 +1024,12 @@ verifyFormat("@property(assign, nonatomic) CGFloat hoverAlpha;"); verifyFormat("@property(assign, getter=isEditable) BOOL editable;"); + verifyFormat("extern UIWindow *MainWindow(void) " + "NS_SWIFT_NAME(getter:MyHelper.mainWindow());"); + + verifyFormat("extern UIWindow *MainWindow(void) " + "CF_SWIFT_NAME(getter:MyHelper.mainWindow());"); + Style.ColumnLimit = 50; verifyFormat("@interface Foo\n" "- (void)doStuffWithFoo:(id)name\n"