[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
Mon Mar 26 01:33:48 PDT 2018


djasper added inline comments.


================
Comment at: lib/Format/Format.cpp:1542
     };
-    for (auto Line : AnnotatedLines) {
-      if (LineContainsObjCCode(*Line))
+    llvm::DenseSet<AnnotatedLine *> LinesToCheckSet;
+    LinesToCheckSet.reserve(AnnotatedLines.size());
----------------
Wouldn't it be much easier to call this function recursively for Children instead of using the lambda as well as this additional set? Lines and their children should form a tree, I think, so you should never see the same line again during recursion.


Repository:
  rC Clang

https://reviews.llvm.org/D44831





More information about the cfe-commits mailing list