Lines Matching +full:align +full:- +full:end
1 //===--- WhitespaceManager.h - Format C++ code ------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
77 /// used to align backslashes correctly.
157 // change, so that the correct column can be reconstructed at the end of
170 return std::make_tuple(Tok->IndentLevel, Tok->NestingLevel,
215 /// \brief Align consecutive C/C++ preprocessor macros over all \c Changes.
218 /// Align consecutive assignments over all \c Changes.
221 /// Align consecutive bitfields over all \c Changes.
224 /// Align consecutive colon. For bitfields, TableGen DAGArgs and defintions.
229 /// Align consecutive declarations over all \c Changes.
232 /// Align consecutive declarations over all \c Changes.
235 /// Align consecutive short case statements over all \c Changes.
238 /// Align consecutive TableGen DAGArg colon over all \c Changes.
241 /// Align consecutive TableGen cond operator colon over all \c Changes.
244 /// Align consecutive TableGen definitions over all \c Changes.
247 /// Align trailing comments over all \c Changes.
250 /// Align trailing comments from change \p Start to change \p End at
252 void alignTrailingComments(unsigned Start, unsigned End, unsigned Column);
254 /// Align escaped newlines over all \c Changes.
257 /// Align escaped newlines from change \p Start to change \p End at
259 void alignEscapedNewlines(unsigned Start, unsigned End, unsigned Column);
261 /// Align Array Initializers over all \c Changes.
264 /// Align Array Initializers from change \p Start to change \p End at
266 void alignArrayInitializers(unsigned Start, unsigned End);
268 /// Align Array Initializers being careful to right justify the columns
272 /// Align Array Initializers being careful to left justify the columns
277 unsigned calculateCellWidth(unsigned Start, unsigned End,
281 /// \p End of the change list.
282 CellDescriptions getCells(unsigned Start, unsigned End);
287 /// Get the width of the preceding cells from \p Start to \p End.
289 auto getNetWidth(const I &Start, const I &End, unsigned InitialSpaces) const {
291 for (auto PrevIter = Start; PrevIter != End; ++PrevIter) {
294 assert(PrevIter->Index < Changes.size());
295 if (Changes[PrevIter->Index].NewlinesBefore > 0)
298 calculateCellWidth(PrevIter->Index, PrevIter->EndIndex, true) + 1;
307 calculateCellWidth(CellIter->Index, CellIter->EndIndex, true);
308 if (Changes[CellIter->Index].NewlinesBefore == 0)
310 for (const auto *Next = CellIter->NextColumnElement; Next;
311 Next = Next->NextColumnElement) {
312 auto ThisWidth = calculateCellWidth(Next->Index, Next->EndIndex, true);
313 if (Changes[Next->Index].NewlinesBefore == 0)
328 for (const auto *Next = CellStop->NextColumnElement; Next;
329 Next = Next->NextColumnElement) {
333 auto End = Start + Offset;
335 std::max(MaxNetWidth, getNetWidth(Start, End, InitialSpaces));
341 /// Align a split cell with a newline to the first element in the cell.
342 void alignToStartOfCell(unsigned Start, unsigned End);