[PATCH] D33589: clang-format: consider not splitting tokens in optimization
Francois Ferrand via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 24 09:16:32 PDT 2017
Typz added a comment.
> My question is: if CanBreak is false, we currently don't call breakProtrudingToken. So either we do something very wrong in that case (which might be true, but I'd like to understand why) or we should be able to just calculate the penalty by not breaking anything and go on.
CanBreak is currently very short, it only verifies some very broad conditions. I initiallly tried patching at this level, but it really does not work.
In addition, replacement is non trivial even in case we choose not to reflow: it is required in order to properly manage whitespaces. For this reason we really must pass through the loop in most cases.
More information about the cfe-commits