[PATCH] D44994: [clang-format] Ensure wrapped ObjC selectors with 1 arg obey IndentWrappedFunctionNames

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 29 05:27:13 PDT 2018


djasper added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:899
     if (!State.Stack.back().ObjCSelectorNameFound) {
+      unsigned MinIndent =
+          (Style.IndentWrappedFunctionNames
----------------
I think I'd now find this slightly easier to read as:

  unsigned MinIndent = State.Stack.back().Indent;
  if (Style.IndentWrappedFunctionNames)
    MinIndent = std::max(MinIndent, State.FirstIndent + Style.ContinuationIndentWidth);


================
Comment at: lib/Format/ContinuationIndenter.cpp:904
+               : State.Stack.back().Indent);
       if (NextNonComment->LongestObjCSelectorName == 0)
+        return MinIndent;
----------------
Does this if actually change the behavior in any way? With LongestObjCSelectorName being 0, isn't that:

  return MinIndent +
         std::max(0, ColumnWidth) - ColumnWidth;

(and with ColumnWidth being >= 0, this should be just MinIndent)


Repository:
  rC Clang

https://reviews.llvm.org/D44994





More information about the cfe-commits mailing list