[PATCH] D44831: [clang-format] Refine ObjC guesser to handle child lines of child lines

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 02:09:40 PDT 2018


djasper added inline comments.


================
Comment at: lib/Format/Format.cpp:1449
                           const AdditionalKeywords &Keywords) {
+    for (auto Line : AnnotatedLines)
+      if (LineContainsObjCCode(*Line, Keywords))
----------------
I would not create a second function here. Just iterate over the tokens here and call guessIsObjC recursively with Line->Children. That means we need one less for loop overall, I think (I might be missing something).


================
Comment at: lib/Format/Format.cpp:1455
+
+  static bool LineContainsObjCCode(const AnnotatedLine &Line,
+                                   const AdditionalKeywords &Keywords) {
----------------
Convention would be lineContainsObjCCode.


Repository:
  rC Clang

https://reviews.llvm.org/D44831





More information about the cfe-commits mailing list