[PATCH] Avoid column limit violation in block comments in certain cases.

Daniel Jasper djasper at google.com
Mon Jul 1 06:26:24 PDT 2013


  Looks good. I have added suggestions for slightly improving the comments.


================
Comment at: lib/Format/Format.cpp:811
@@ -810,3 +810,3 @@
   /// already handled in \c addNextStateToQueue; the returned penalty will only
   /// cover the cost of the additional line breaks.
   unsigned breakProtrudingToken(const FormatToken &Current, LineState &State,
----------------
Maybe add: This only applies for the last line of a multi-line token.

================
Comment at: lib/Format/Format.cpp:858
@@ +857,3 @@
+        if (Split.first == StringRef::npos) {
+          // Penalty for the last line will be added outside.
+          if (LineIndex < EndIndex - 1)
----------------
Maybe:
// The last line's penalty is handled by addNextStateToQueue().


http://llvm-reviews.chandlerc.com/D1071

BRANCH
  svn

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list