[PATCH] D40605: Better trade-off for excess characters vs. staying within the column limits.

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 05:34:37 PST 2017


krasimir added a subscriber: djasper.
krasimir added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:1422
+                           Strict);
+    }
   }
----------------
The problem here is that we're calling breakProtrudingToken 3 times more than we used to. Seems like such a waste.
@djasper: do you think this is fine?


================
Comment at: lib/Format/ContinuationIndenter.cpp:1519
   if (!Token)
-    return 0;
+    return {0, true};
   assert(Token->getLineCount() > 0);
----------------
Why we return true here?


================
Comment at: lib/Format/ContinuationIndenter.cpp:1773
                     Style.PenaltyExcessCharacter;
                 if (NewBreakPenalty < ExcessCharactersPenalty) {
                   Reflow = false;
----------------
Shouldn't we also be messing up something here in this patch?


Repository:
  rC Clang

https://reviews.llvm.org/D40605





More information about the cfe-commits mailing list