This revision was automatically updated to reflect the committed changes.
Closed by commit rL326815: [clang-format] Improve detection of ObjC for-in
statements (authored by benhamilton, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D4
benhamilton added inline comments.
Comment at: unittests/Format/FormatTest.cpp:778
+TEST_F(FormatTest, ObjCForInLoop) {
+ verifyFormat("for (Foo *x = 0; x != in; x++) {\n}");
krasimir wrote:
> Please move the ObjC-specific instances to `FormatTestObjC.cpp`.
Do
benhamilton updated this revision to Diff 137199.
benhamilton marked an inline comment as done.
benhamilton added a comment.
- Move ObjC-specific tests to `FormatTestObjC.cpp`.
Repository:
rC Clang
https://reviews.llvm.org/D43904
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/Form
krasimir added inline comments.
Comment at: unittests/Format/FormatTest.cpp:778
+TEST_F(FormatTest, ObjCForInLoop) {
+ verifyFormat("for (Foo *x = 0; x != in; x++) {\n}");
Please move the ObjC-specific instances to `FormatTestObjC.cpp`.
Repository:
rC Clan
benhamilton added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:288
+if (MightBeObjCForRangeLoop) {
+ FormatToken *ForInToken = Left;
djasper wrote:
> There can be only one ObjCForIn token in any for loop, right? If that's the
> c
benhamilton updated this revision to Diff 137093.
benhamilton added a comment.
One more cleanup
Repository:
rC Clang
https://reviews.llvm.org/D43904
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTest.cpp
=
benhamilton updated this revision to Diff 137092.
benhamilton marked an inline comment as done.
benhamilton added a comment.
- Fix comments from @djasper and @krasimir.
Repository:
rC Clang
https://reviews.llvm.org/D43904
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.c
krasimir added inline comments.
Comment at: unittests/Format/FormatTest.cpp:12002
+TEST_F(FormatTest, GuessLanguageWithForIn) {
+ EXPECT_EQ(FormatStyle::LK_Cpp,
Please also add this instances as formatting tests.
Repository:
rC Clang
https://reviews.llvm.
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:288
+if (MightBeObjCForRangeLoop) {
+ FormatToken *ForInToken = Left;
There can be only one ObjCForIn token in any for loop, right? If that's the
case, can we just rememb
benhamilton created this revision.
benhamilton added reviewers: krasimir, jolesiak.
Herald added a subscriber: cfe-commits.
Previously, clang-format would detect the following as an
Objective-C for-in statement:
for (int x = in.value(); ...) {}
because the logic only decided a for-loop was def
10 matches
Mail list logo