[PATCH] D89425: [Format/ObjC] Add NS_SWIFT_NAME() and CF_SWIFT_NAME() to WhitespaceSensitiveMacros
Ben Hamilton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 14 14:44:04 PDT 2020
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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89425.298245.patch
Type: text/x-patch
Size: 1341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201014/f30da94c/attachment.bin>
More information about the cfe-commits
mailing list