djasper added inline comments.
================
Comment at: lib/Format/WhitespaceManager.cpp:163-171
@@ -162,9 +162,11 @@
unsigned MinColumn = 0;
unsigned MaxColumn = UINT_MAX;
unsigned StartOfSequence = 0;
unsigned EndOfSequence = 0;
bool FoundAssignmentOnLine = false;
- bool FoundLeftBraceOnLine = false;
- bool FoundLeftParenOnLine = false;
+ unsigned LeftBracesOnLine = 0;
+ unsigned LeftParensOnLine = 0;
+ unsigned CommasOnPrevLine = 0;
+ unsigned CommasOnLine = 0;
----------------
Hm. So many lokal variables. I think it might make sense to wrap these in a
class/struct? That could be a first step to re-using code in
alignConsecutiveDeclarations.
Also, a comment would help here. Specifically, a comment explaining why you
count commas, braces and parentheses (not explaining that this variables count
them ;-) )
================
Comment at: lib/Format/WhitespaceManager.cpp:220
@@ -216,1 +219,3 @@
+ else
+ LeftBracesOnLine--;
} else if (Changes[i].Kind == tok::l_brace) {
----------------
Use (here and everywhere else):
--LeftBracesOnLine;
http://reviews.llvm.org/D14325
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits