Lines Matching refs:Line

23 bool startsExternCBlock(const AnnotatedLine &Line) {  in startsExternCBlock()  argument
24 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
26 return Line.startsWith(tok::kw_extern) && Next && Next->isStringLiteral() && in startsExternCBlock()
54 void nextLine(const AnnotatedLine &Line) { in nextLine() argument
55 Offset = getIndentOffset(*Line.First); in nextLine()
58 while (IndentForLevel.size() <= Line.Level) in nextLine()
60 if (Line.InPPDirective) { in nextLine()
61 Indent = Line.Level * Style.IndentWidth + AdditionalIndent; in nextLine()
63 IndentForLevel.resize(Line.Level + 1); in nextLine()
64 Indent = getIndent(IndentForLevel, Line.Level); in nextLine()
72 void skipLine(const AnnotatedLine &Line) { in skipLine() argument
73 while (IndentForLevel.size() <= Line.Level) in skipLine()
82 void adjustToUnmodifiedLine(const AnnotatedLine &Line) { in adjustToUnmodifiedLine() argument
83 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
86 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
87 !Line.InPPDirective) in adjustToUnmodifiedLine()
88 IndentForLevel[Line.Level] = LevelIndent; in adjustToUnmodifiedLine()
138 bool isNamespaceDeclaration(const AnnotatedLine *Line) { in isNamespaceDeclaration() argument
139 const FormatToken *NamespaceTok = Line->First; in isNamespaceDeclaration()
143 bool isEndOfNamespace(const AnnotatedLine *Line, in isEndOfNamespace() argument
145 if (!Line->startsWith(tok::r_brace)) in isEndOfNamespace()
147 size_t StartLineIndex = Line->MatchingOpeningBlockLineIndex; in isEndOfNamespace()
409 AnnotatedLine &Line = **I; in tryMergeSimpleControlStatement() local
410 if (Line.Last->isNot(tok::r_paren)) in tryMergeSimpleControlStatement()
418 if (I + 2 != E && Line.startsWith(tok::kw_if) && in tryMergeSimpleControlStatement()
441 const AnnotatedLine *Line = I[1 + NumStmts]; in tryMergeShortCaseLabels() local
442 if (Line->InPPDirective != InPPDirective) in tryMergeShortCaseLabels()
444 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
446 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch, in tryMergeShortCaseLabels()
450 if (Line->First->is(tok::comment)) { in tryMergeShortCaseLabels()
451 if (Level != Line->Level) in tryMergeShortCaseLabels()
455 Line = *J; in tryMergeShortCaseLabels()
456 if (Line->InPPDirective != InPPDirective) in tryMergeShortCaseLabels()
458 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
460 if (Line->First->isNot(tok::comment) || Level != Line->Level) in tryMergeShortCaseLabels()
465 if (Line->Last->is(tok::comment)) in tryMergeShortCaseLabels()
478 AnnotatedLine &Line = **I; in tryMergeSimpleBlock() local
484 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) in tryMergeSimpleBlock()
489 if (Line.First->isOneOf(tok::kw_else, tok::kw_case) || in tryMergeSimpleBlock()
490 (Line.First->Next && Line.First->Next->is(tok::kw_else))) in tryMergeSimpleBlock()
493 if (Line.First->is(tok::kw_default)) { in tryMergeSimpleBlock()
494 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
498 if (Line.First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_do, tok::kw_try, in tryMergeSimpleBlock()
506 Line.startsWith(tok::kw_if) && in tryMergeSimpleBlock()
511 Line.startsWith(tok::kw_if) && in tryMergeSimpleBlock()
516 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
521 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
530 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
535 if (Line.Last->is(tok::l_brace)) { in tryMergeSimpleBlock()
544 } else if (Limit != 0 && !Line.startsWithNamespace() && in tryMergeSimpleBlock()
545 !startsExternCBlock(Line)) { in tryMergeSimpleBlock()
547 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
631 bool containsMustBreak(const AnnotatedLine *Line) { in containsMustBreak() argument
632 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { in containsMustBreak()
694 virtual unsigned formatLine(const AnnotatedLine &Line,
765 /*StartOfTokenColumn=*/State.Column, State.Line->InPPDirective); in formatChildren()
793 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
797 &Line, /*DryRun=*/false); in formatLine()
819 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
823 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun); in formatLine()
844 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
847 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun); in formatLine()
851 if (State.Line->Type == LT_ObjCMethodDecl) in formatLine()
1039 for (const AnnotatedLine *Line = in format() local
1041 Line; Line = NextLine, FirstLine = false) { in format()
1042 const AnnotatedLine &TheLine = *Line; in format()
1063 Status->Line = in format()
1069 bool LastLine = Line->First->is(tok::eof); in format()
1137 const AnnotatedLine &Line, const AnnotatedLine *PreviousLine, in formatFirstToken() argument
1140 FormatToken &RootToken = *Line.First; in formatFirstToken()
1155 !getNamespaceToken(&Line, Lines)) in formatFirstToken()
1158 if (PreviousLine == nullptr && Line.Level > 0) in formatFirstToken()
1186 if (Line.Type == LT_PreprocessorDirective || Line.Type == LT_ImportStatement) in formatFirstToken()
1190 Line.InPPDirective && in formatFirstToken()