================ @@ -278,6 +278,33 @@ void WhitespaceManager::calculateLineBreakInformation() { } } +// Sets the spaces in front of a Change, and updates the start/end columns of +// subsequent tokens so that trailing comments and escaped newlines can be +// aligned properly +static void +SetChangeSpaces(unsigned Start, unsigned Spaces, + SmallVector<WhitespaceManager::Change, 16> &Changes) { + WhitespaceManager::Change &FirstChange = Changes[Start]; + const int ColumnChange = Spaces - FirstChange.Spaces; + + if (ColumnChange == 0) + return; + + FirstChange.Spaces += ColumnChange; + FirstChange.StartOfTokenColumn += ColumnChange; + + for (unsigned i = Start + 1; i < Changes.size(); i++) { ---------------- HazardyKnusperkeks wrote:
```suggestion for (auto I = Start + 1; i < Changes.size(); i++) { ``` https://github.com/llvm/llvm-project/pull/143781 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits