This revision was automatically updated to reflect the committed changes. Closed by commit rGe7b4feea8e1b: [Format/ObjC] Add NS_SWIFT_NAME() and CF_SWIFT_NAME() to… (authored by benhamilton).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89425/new/ https://reviews.llvm.org/D89425 Files: clang/lib/Format/Format.cpp clang/unittests/Format/FormatTestObjC.cpp Index: clang/unittests/Format/FormatTestObjC.cpp =================================================================== --- clang/unittests/Format/FormatTestObjC.cpp +++ 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" Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ 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) {
Index: clang/unittests/Format/FormatTestObjC.cpp =================================================================== --- clang/unittests/Format/FormatTestObjC.cpp +++ 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" Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ 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) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits