[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 5 10:45:11 PST 2018

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 remember that in addition to (or instead of) MightBeObjCForRangeLoop? That way, we wouldn't have to re-iterate over all the tokens here, but could just set this directly.

  rC Clang


More information about the cfe-commits mailing list