[PATCH] D14325: [clang-format] Do not align assignments that aren't after the same number of commas. (Closes: 25329)

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 15:07:48 PST 2015


djasper added a comment.

I like it :-)


================
Comment at: lib/Format/WhitespaceManager.cpp:151
@@ -150,13 +150,3 @@
 
-// Walk through all of the changes and find sequences of "=" to align.  To do
-// so, keep track of the lines and whether or not an "=" was found on align. If
-// a "=" is found on a line, extend the current sequence. If the current line
-// cannot be part of a sequence, e.g. because there is an empty line before it
-// or it contains non-assignments, finalize the previous sequence.
-//
-// FIXME: The code between assignment and declaration alignment is mostly
-// duplicated and would benefit from factorization.
-void WhitespaceManager::alignConsecutiveAssignments() {
-  if (!Style.AlignConsecutiveAssignments)
-    return;
-
+struct TokenSequenceAligner {
+  template <typename F>
----------------
Why is this a class/struct? It doesn't seem to have any state.


http://reviews.llvm.org/D14325





More information about the cfe-commits mailing list