Lines Matching full:changes
46 Changes.clear(); in reset()
57 Changes.push_back( in replaceWhitespace()
69 Changes.push_back(Change( in addUntouchableToken()
84 Changes.push_back(Change( in replaceWhitespaceInToken()
94 if (Changes.empty()) in generateReplacements()
97 std::sort(Changes.begin(), Changes.end(), Change::IsBeforeInFile(SourceMgr)); in generateReplacements()
109 Changes[0].PreviousEndOfTokenColumn = 0; in calculateLineBreakInformation()
110 Change *LastOutsideTokenChange = &Changes[0]; in calculateLineBreakInformation()
111 for (unsigned i = 1, e = Changes.size(); i != e; ++i) { in calculateLineBreakInformation()
113 SourceMgr.getFileOffset(Changes[i].OriginalWhitespaceRange.getBegin()); in calculateLineBreakInformation()
115 Changes[i - 1].OriginalWhitespaceRange.getEnd()); in calculateLineBreakInformation()
116 Changes[i - 1].TokenLength = OriginalWhitespaceStart - in calculateLineBreakInformation()
118 Changes[i].PreviousLinePostfix.size() + in calculateLineBreakInformation()
119 Changes[i - 1].CurrentLinePrefix.size(); in calculateLineBreakInformation()
121 // If there are multiple changes in this token, sum up all the changes until in calculateLineBreakInformation()
123 if (Changes[i - 1].IsInsideToken) in calculateLineBreakInformation()
125 Changes[i - 1].TokenLength + Changes[i - 1].Spaces; in calculateLineBreakInformation()
127 LastOutsideTokenChange = &Changes[i - 1]; in calculateLineBreakInformation()
129 Changes[i].PreviousEndOfTokenColumn = in calculateLineBreakInformation()
130 Changes[i - 1].StartOfTokenColumn + Changes[i - 1].TokenLength; in calculateLineBreakInformation()
132 Changes[i - 1].IsTrailingComment = in calculateLineBreakInformation()
133 (Changes[i].NewlinesBefore > 0 || Changes[i].Kind == tok::eof || in calculateLineBreakInformation()
134 (Changes[i].IsInsideToken && Changes[i].Kind == tok::comment)) && in calculateLineBreakInformation()
135 Changes[i - 1].Kind == tok::comment; in calculateLineBreakInformation()
139 Changes.back().TokenLength = 0; in calculateLineBreakInformation()
140 Changes.back().IsTrailingComment = Changes.back().Kind == tok::comment; in calculateLineBreakInformation()
143 for (auto &Change : Changes) { in calculateLineBreakInformation()
144 // Reset the IsTrailingComment flag for changes inside of trailing comments in calculateLineBreakInformation()
167 SmallVector<WhitespaceManager::Change, 16> &Changes) { in AlignTokenSequence() argument
171 if (Changes[i].NewlinesBefore > 0) { in AlignTokenSequence()
177 // spaces it has to be shifted, so the rest of the changes on the line are in AlignTokenSequence()
179 if (!FoundMatchOnLine && Matches(Changes[i])) { in AlignTokenSequence()
181 Shift = Column - Changes[i].StartOfTokenColumn; in AlignTokenSequence()
182 Changes[i].Spaces += Shift; in AlignTokenSequence()
186 Changes[i].StartOfTokenColumn += Shift; in AlignTokenSequence()
187 if (i + 1 != Changes.size()) in AlignTokenSequence()
188 Changes[i + 1].PreviousEndOfTokenColumn += Shift; in AlignTokenSequence()
192 // Walk through all of the changes and find sequences of matching tokens to
200 SmallVector<WhitespaceManager::Change, 16> &Changes) { in AlignTokens() argument
236 Changes); in AlignTokens()
243 for (unsigned i = 0, e = Changes.size(); i != e; ++i) { in AlignTokens()
244 if (Changes[i].NewlinesBefore != 0) { in AlignTokens()
249 if (Changes[i].NewlinesBefore > 1 || !FoundMatchOnLine) in AlignTokens()
255 if (Changes[i].Kind == tok::comma) { in AlignTokens()
257 } else if (Changes[i].Kind == tok::r_brace || in AlignTokens()
258 Changes[i].Kind == tok::r_paren || in AlignTokens()
259 Changes[i].Kind == tok::r_square) { in AlignTokens()
261 } else if (Changes[i].Kind == tok::l_brace || in AlignTokens()
262 Changes[i].Kind == tok::l_paren || in AlignTokens()
263 Changes[i].Kind == tok::l_square) { in AlignTokens()
270 if (!Matches(Changes[i])) in AlignTokens()
287 unsigned ChangeMinColumn = Changes[i].StartOfTokenColumn; in AlignTokens()
288 int LineLengthAfter = -Changes[i].Spaces; in AlignTokens()
289 for (unsigned j = i; j != e && Changes[j].NewlinesBefore == 0; ++j) in AlignTokens()
290 LineLengthAfter += Changes[j].Spaces + Changes[j].TokenLength; in AlignTokens()
304 EndOfSequence = Changes.size(); in AlignTokens()
319 if (&C != &Changes.back() && (&C + 1)->NewlinesBefore > 0) in alignConsecutiveAssignments()
324 Changes); in alignConsecutiveAssignments()
339 Changes); in alignConsecutiveDeclarations()
348 for (unsigned i = 0, e = Changes.size(); i != e; ++i) { in alignTrailingComments()
349 if (Changes[i].StartOfBlockComment) in alignTrailingComments()
351 Newlines += Changes[i].NewlinesBefore; in alignTrailingComments()
352 if (!Changes[i].IsTrailingComment) in alignTrailingComments()
355 unsigned ChangeMinColumn = Changes[i].StartOfTokenColumn; in alignTrailingComments()
356 unsigned ChangeMaxColumn = Style.ColumnLimit - Changes[i].TokenLength; in alignTrailingComments()
360 if (!Changes[i].CreateReplacement) in alignTrailingComments()
363 if (i + 1 != e && Changes[i + 1].ContinuesPPDirective) in alignTrailingComments()
367 bool FollowsRBraceInColumn0 = i > 0 && Changes[i].NewlinesBefore == 0 && in alignTrailingComments()
368 Changes[i - 1].Kind == tok::r_brace && in alignTrailingComments()
369 Changes[i - 1].StartOfTokenColumn == 0; in alignTrailingComments()
371 if (Changes[i].NewlinesBefore == 1) { // A comment on its own line. in alignTrailingComments()
373 Changes[i].OriginalWhitespaceRange.getEnd()); in alignTrailingComments()
375 if (Changes[j].Kind == tok::comment || in alignTrailingComments()
376 Changes[j].Kind == tok::unknown) in alignTrailingComments()
382 Changes[j].OriginalWhitespaceRange.getEnd()); in alignTrailingComments()
400 (Changes[i].NewlinesBefore == 1 && i > 0 && in alignTrailingComments()
401 !Changes[i - 1].IsTrailingComment) || in alignTrailingComments()
412 (i == 0) || (Changes[i].NewlinesBefore > 1) || in alignTrailingComments()
415 (Changes[i].NewlinesBefore == 1 && StartOfSequence == i); in alignTrailingComments()
418 alignTrailingComments(StartOfSequence, Changes.size(), MinColumn); in alignTrailingComments()
425 if (Changes[i].IsTrailingComment) { in alignTrailingComments()
426 Shift = Column - Changes[i].StartOfTokenColumn; in alignTrailingComments()
428 if (Changes[i].StartOfBlockComment) { in alignTrailingComments()
429 Shift = Changes[i].IndentationOffset + in alignTrailingComments()
430 Changes[i].StartOfBlockComment->StartOfTokenColumn - in alignTrailingComments()
431 Changes[i].StartOfTokenColumn; in alignTrailingComments()
434 Changes[i].Spaces += Shift; in alignTrailingComments()
436 Changes[i + 1].PreviousEndOfTokenColumn += Shift; in alignTrailingComments()
437 Changes[i].StartOfTokenColumn += Shift; in alignTrailingComments()
445 for (unsigned i = 1, e = Changes.size(); i < e; ++i) { in alignEscapedNewlines()
446 Change &C = Changes[i]; in alignEscapedNewlines()
457 alignEscapedNewlines(StartOfMacro + 1, Changes.size(), MaxEndOfLine); in alignEscapedNewlines()
463 Change &C = Changes[i]; in alignEscapedNewlines()
475 for (unsigned i = 0, e = Changes.size(); i != e; ++i) { in generateChanges()
476 const Change &C = Changes[i]; in generateChanges()
478 assert(Changes[i - 1].OriginalWhitespaceRange.getBegin() != in generateChanges()