Home | History | Annotate | Download | only in Format

Lines Matching full:penalty

801     // Try to look up already computed penalty in DryRun-mode.
809 unsigned Penalty = 0;
883 formatChildren(State, /*Newline=*/false, /*DryRun=*/false, Penalty);
892 Penalty += format(TheLine, Indent, DryRun);
933 PenaltyCache[CacheKey] = Penalty;
934 return Penalty;
938 /// \brief Formats an \c AnnotatedLine and returns the penalty.
964 /// \brief A pair of <penalty, count> that is used to prioritize the BFS on.
1069 /// find the shortest path (the one with lowest penalty) from \p InitialState
1070 /// to a state where all tokens are placed. Returns the penalty.
1087 unsigned Penalty = 0;
1091 Penalty = Queue.top().first.first;
1094 DEBUG(llvm::dbgs() << "\n---\nPenalty for line: " << Penalty << "\n");
1105 // State already examined with lower penalty.
1110 addNextStateToQueue(Penalty, Node, /*NewLine=*/false, &Count, &Queue);
1112 addNextStateToQueue(Penalty, Node, /*NewLine=*/true, &Count, &Queue);
1129 return Penalty;
1141 unsigned Penalty = 0;
1142 formatChildren(State, (*I)->NewLine, /*DryRun=*/false, Penalty);
1143 Penalty += Indenter->addTokenToState(State, (*I)->NewLine, false);
1147 llvm::dbgs() << "Penalty for placing "
1149 << Penalty << "\n";
1158 /// penalty of \p Penalty. Insert a line break if \p NewLine is \c true.
1159 void addNextStateToQueue(unsigned Penalty, StateNode *PreviousNode,
1168 if (!formatChildren(Node->State, NewLine, /*DryRun=*/true, Penalty))
1171 Penalty += Indenter->addTokenToState(Node->State, NewLine, true);
1173 Queue->push(QueueItem(OrderedPenalty(Penalty, *Count), Node));
1181 /// \p Penalty as well as \p State. If \p DryRun is false, also directly
1198 unsigned &Penalty) {
1216 Penalty += format(Previous.Children, DryRun, AdditionalIndent,
1246 Penalty += format(*Previous.Children[0], State.Column + 1, DryRun);
1259 // Cache to store the penalty of formatting a vector of AnnotatedLines