Home | History | Annotate | Download | only in Format

Lines Matching refs:Penalty

482   /// \brief Formats an \c AnnotatedLine and returns the penalty.
493 /// \p Penalty as well as \p State. If \p DryRun is false, also directly
510 unsigned &Penalty) {
523 Penalty +=
557 Penalty += formatLine(*Previous.Children[0], State.Column + 1, DryRun);
591 unsigned Penalty = 0;
592 formatChildren(State, Newline, /*DryRun=*/false, Penalty);
610 unsigned Penalty = 0;
613 formatChildren(State, /*Newline=*/false, DryRun, Penalty);
616 return Penalty;
651 /// \brief A pair of <penalty, count> that is used to prioritize the BFS on.
680 /// find the shortest path (the one with lowest penalty) from \p InitialState
681 /// to a state where all tokens are placed. Returns the penalty.
698 unsigned Penalty = 0;
702 Penalty = Queue.top().first.first;
705 DEBUG(llvm::dbgs() << "\n---\nPenalty for line: " << Penalty << "\n");
716 // State already examined with lower penalty.
721 addNextStateToQueue(Penalty, Node, /*NewLine=*/false, &Count, &Queue);
723 addNextStateToQueue(Penalty, Node, /*NewLine=*/true, &Count, &Queue);
740 return Penalty;
746 /// penalty of \p Penalty. Insert a line break if \p NewLine is \c true.
747 void addNextStateToQueue(unsigned Penalty, StateNode *PreviousNode,
756 if (!formatChildren(Node->State, NewLine, /*DryRun=*/true, Penalty))
759 Penalty += Indenter->addTokenToState(Node->State, NewLine, true);
761 Queue->push(QueueItem(OrderedPenalty(Penalty, *Count), Node));
776 unsigned Penalty = 0;
777 formatChildren(State, (*I)->NewLine, /*DryRun=*/false, Penalty);
778 Penalty += Indenter->addTokenToState(State, (*I)->NewLine, false);
783 llvm::dbgs() << "Penalty for placing "
785 << Penalty << "\n";
802 // Try to look up already computed penalty in DryRun-mode.
810 unsigned Penalty = 0;
858 Penalty += NoLineBreakFormatter(Indenter, Whitespaces, Style, this)
861 Penalty += OptimizingLineFormatter(Indenter, Whitespaces, Style, this)
902 PenaltyCache[CacheKey] = Penalty;
903 return Penalty;