klimek added a comment.
I find the current semantics of the functions a bit surprising, specifically:
... reflowProtrudingToken(..., bool Reflow)
is really confusing me :)
I'd have expected something like this where we currently call
breakProtrudingToken():
if (CanBreak) {
ReflowPenalty = breakProtrudingToken(Current, State, /*DryRun=*/true);
FixedPenalty = getExcessPenalty(Current, State);
Penalty = ReflowPenalty < FixedPenalty ? ReflowPenalty : FixedPenalty;
if (!DryRun && ReflowPenalty < FixedPenalty
breakProtrudingToken(Current, State, /*DryRun=*/false);
}
I haven't looked how we calculate the penalty currently if we can't break, as
if we don't, that also seems ... wrong.
getExcessPenalty would be a new function that just focuses on getting the
excess penalty for a breakable token.
https://reviews.llvm.org/D33589
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits