reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Format/AffectedRangeManager.cpp
  119   for (FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) {
  137       Line->First->is(tok::comment) && Line->First->Next == nullptr &&
tools/clang/lib/Format/BreakableToken.cpp
  732        CurrentTok = CurrentTok->Next) {
  789     LineTok = CurrentTok->Next;
  790     if (CurrentTok->Next && !CurrentTok->Next->ContinuesLineCommentSection) {
  790     if (CurrentTok->Next && !CurrentTok->Next->ContinuesLineCommentSection) {
  953     State.NextToken = LastLineTok->Next;
tools/clang/lib/Format/ContinuationIndenter.cpp
   91   for (; End->Next; End = End->Next) {
   91   for (; End->Next; End = End->Next) {
   92     if (End->Next->CanBreakBefore)
   94     if (!End->Next->closesScope())
   96     if (End->Next->MatchingParen &&
   97         End->Next->MatchingParen->isOneOf(
   99       const ParenState *State = FindParenState(End->Next->MatchingParen);
  973       (!Current.Next ||
  974        Current.Next->isOneOf(tok::semi, tok::kw_const, tok::l_brace)))
  978   if (Current.is(tok::identifier) && Current.Next &&
  979       (Current.Next->is(TT_DictLiteral) ||
  982         Current.Next->isOneOf(tok::less, tok::l_brace))))
 1049       NextNonComment->Next && NextNonComment->Next->is(TT_ObjCMethodExpr))
 1049       NextNonComment->Next && NextNonComment->Next->is(TT_ObjCMethodExpr))
 1206   State.NextToken = State.NextToken->Next;
 1394              Tok && Tok != Current.MatchingParen; Tok = Tok->Next) {
 1564       (!Newline && Current.Next && Current.Next->is(tok::r_paren))
 1564       (!Newline && Current.Next && Current.Next->is(tok::r_paren))
tools/clang/lib/Format/Format.cpp
 1269            FormatTok = FormatTok->Next) {
 1381       for (FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next) {
 1381       for (FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next) {
 1398       for (FormatToken *Tok = Line->First; Tok && Tok->Next; Tok = Tok->Next) {
 1398       for (FormatToken *Tok = Line->First; Tok && Tok->Next; Tok = Tok->Next) {
 1403         bool SpaceAfter = Tok->Next->WhitespaceRange.getBegin() !=
 1404                           Tok->Next->WhitespaceRange.getEnd();
 1419       if (!AnnotatedLines[i]->First->Next)
 1421       FormatToken *Tok = AnnotatedLines[i]->First->Next;
 1422       while (Tok->Next) {
 1428         Tok = Tok->Next;
 1495     for (FormatToken *Tok = Line.First; Tok != nullptr; Tok = Tok->Next) {
 1516         Tok = Tok->Next;
 1586       for (auto *Res = Tok.Next; Res; Res = Res->Next)
 1586       for (auto *Res = Tok.Next; Res; Res = Res->Next)
 1598         for (auto *Tok = Left->Next; Tok && Tok != Right; Tok = Tok->Next)
 1598         for (auto *Tok = Left->Next; Tok && Tok != Right; Tok = Tok->Next)
 1638              Tokens[End]->Next == Tokens[End + 1]) {
 1773            FormatTok = FormatTok->Next) {
tools/clang/lib/Format/FormatToken.cpp
   88       LBrace->Next->Type == TT_DesignatedInitializerPeriod)
  174   FormatToken *ItemBegin = Token->Next;
  176     ItemBegin = ItemBegin->Next;
  187       ItemBegin = ItemBegin->Next;
  203         while (ItemEnd->Next && !ItemEnd->Next->CanBreakBefore)
  203         while (ItemEnd->Next && !ItemEnd->Next->CanBreakBefore)
  204           ItemEnd = ItemEnd->Next;
  215       if (ItemEnd->Next && !ItemEnd->Next->HasUnescapedNewline &&
  215       if (ItemEnd->Next && !ItemEnd->Next->HasUnescapedNewline &&
  216           ItemEnd->Next->isTrailingComment())
  217         ItemEnd = ItemEnd->Next;
  224     ItemBegin = ItemEnd->Next;
tools/clang/lib/Format/FormatToken.h
  369            (!ColonRequired || (Next && Next->is(tok::colon)));
  369            (!ColonRequired || (Next && Next->is(tok::colon)));
  376     return is(tok::at) && Next &&
  377            (Next->isObjCAtKeyword(tok::objc_public) ||
  378             Next->isObjCAtKeyword(tok::objc_protected) ||
  379             Next->isObjCAtKeyword(tok::objc_package) ||
  380             Next->isObjCAtKeyword(tok::objc_private));
  434            (is(TT_LineComment) || !Next || Next->NewlinesBefore > 0);
  434            (is(TT_LineComment) || !Next || Next->NewlinesBefore > 0);
  496     const FormatToken *Tok = Next;
  498       Tok = Tok->Next;
  557     if (is(tok::comment) && Next)
  558       return Next->startsSequenceInternal(K1, Tokens...);
  559     return is(K1) && Next && Next->startsSequenceInternal(Tokens...);
  559     return is(K1) && Next && Next->startsSequenceInternal(Tokens...);
  563     if (is(tok::comment) && Next)
  564       return Next->startsSequenceInternal(K1);
tools/clang/lib/Format/NamespaceEndCommentsFixer.cpp
   85   return RBraceTok->Next && RBraceTok->Next->is(tok::comment);
   85   return RBraceTok->Next && RBraceTok->Next->is(tok::comment);
   91   const FormatToken *Comment = RBraceTok->Next;
  143   const FormatToken *Comment = RBraceTok->Next;
  207     if (RBraceTok->Next && RBraceTok->Next->is(tok::semi)) {
  207     if (RBraceTok->Next && RBraceTok->Next->is(tok::semi)) {
  208       EndCommentPrevTok = RBraceTok->Next;
  237     const FormatToken *EndCommentNextTok = EndCommentPrevTok->Next;
  239       EndCommentNextTok = EndCommentNextTok->Next;
tools/clang/lib/Format/SortJavaScriptImports.cpp
  217       Tok = Tok->Next;
  222     Current = Current->Next;
  224     if (!Current || Current == LineEnd->Next) {
  419           Current->getPreviousNonComment()->Next->WhitespaceRange.getBegin());
tools/clang/lib/Format/TokenAnnotator.cpp
  259       if (LookForDecls && CurrentToken->Next) {
  263           FormatToken *Next = CurrentToken->Next;
  282         if (MightBeFunctionType && ProbablyFunctionType && CurrentToken->Next &&
  283             (CurrentToken->Next->is(tok::l_paren) ||
  284              (CurrentToken->Next->is(tok::l_square) && Line.MustBeDeclaration)))
  285           Left->Type = Left->Next->is(tok::caret) ? TT_ObjCBlockLParen
  290         if (CurrentToken->Next && CurrentToken->Next->is(tok::l_brace) &&
  290         if (CurrentToken->Next && CurrentToken->Next->is(tok::l_brace) &&
  295           for (FormatToken *Tok = Left; Tok != CurrentToken; Tok = Tok->Next) {
  334       if (CurrentToken->is(tok::comma) && CurrentToken->Next &&
  335           !CurrentToken->Next->HasUnescapedNewline &&
  336           !CurrentToken->Next->isTrailingComment())
  372     const FormatToken *AttrTok = Tok.Next;
  382       AttrTok = AttrTok->Next;
  389     AttrTok = AttrTok->Next;
  401     if (AttrTok->Next &&
  402         AttrTok->Next->startsSequence(tok::identifier, tok::l_paren))
  415     const FormatToken *AttrTok = Tok.Next->Next;
  415     const FormatToken *AttrTok = Tok.Next->Next;
  434       AttrTok = AttrTok->Next;
  570         else if (((CurrentToken->Next &&
  571                    CurrentToken->Next->is(tok::l_paren)) ||
  597         if (CurrentToken->Type == TT_ObjCMethodExpr && CurrentToken->Next &&
  598             CurrentToken->Next->is(TT_LambdaArrow))
  599           CurrentToken->Next->Type = TT_Unknown;
  827       } else if (canBeObjCSelectorComponent(*Tok->Previous) && Tok->Next &&
  828                  (Tok->Next->isOneOf(tok::r_paren, tok::comma) ||
  829                   (canBeObjCSelectorComponent(*Tok->Next) && Tok->Next->Next &&
  829                   (canBeObjCSelectorComponent(*Tok->Next) && Tok->Next->Next &&
  829                   (canBeObjCSelectorComponent(*Tok->Next) && Tok->Next->Next &&
  830                    Tok->Next->Next->is(tok::colon)))) {
  830                    Tok->Next->Next->is(tok::colon)))) {
  861             (Tok->Next && Tok->Next->is(tok::colon)))
  861             (Tok->Next && Tok->Next->is(tok::colon)))
  965       if (Style.Language == FormatStyle::LK_JavaScript && Tok->Next &&
  966           Tok->Next->isOneOf(tok::semi, tok::comma, tok::colon, tok::r_paren,
 1136          CurrentToken->Next &&
 1137          CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier,
 1182             CurrentToken->is(Keywords.kw_from) && CurrentToken->Next &&
 1183             CurrentToken->Next->isStringLiteral())
 1210     return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
 1210     return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
 1211            Tok.Next->Next &&
 1211            Tok.Next->Next &&
 1212            (Tok.Next->Next->TokenText == "module" ||
 1212            (Tok.Next->Next->TokenText == "module" ||
 1213             Tok.Next->Next->TokenText == "provide" ||
 1213             Tok.Next->Next->TokenText == "provide" ||
 1214             Tok.Next->Next->TokenText == "require" ||
 1214             Tok.Next->Next->TokenText == "require" ||
 1215             Tok.Next->Next->TokenText == "requireType" ||
 1215             Tok.Next->Next->TokenText == "requireType" ||
 1216             Tok.Next->Next->TokenText == "forwardDeclare") &&
 1216             Tok.Next->Next->TokenText == "forwardDeclare") &&
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1217            Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
 1245       CurrentToken = CurrentToken->Next;
 1368         if (Current.Next &&
 1369             Current.Next->isOneOf(TT_BinaryOperator, Keywords.kw_as)) {
 1441       if (Current.MatchingParen && Current.Next &&
 1442           !Current.Next->isBinaryOperator() &&
 1443           !Current.Next->isOneOf(tok::semi, tok::colon, tok::l_brace,
 1446         if (FormatToken *AfterParen = Current.MatchingParen->Next) {
 1458     } else if (Current.is(tok::at) && Current.Next &&
 1463       switch (Current.Next->Tok.getObjCKeywordID()) {
 1576     if (Tok.Previous == Tok.MatchingParen || !Tok.Next || !Tok.MatchingParen)
 1604     if (Tok.Next->is(tok::question))
 1609     if (Tok.Next->isOneOf(tok::kw_noexcept, tok::kw_volatile, tok::kw_const,
 1612         isCpp11AttributeSpecifier(*Tok.Next))
 1617     if (Style.Language == FormatStyle::LK_Java && Tok.Next->is(tok::l_paren))
 1621     if (Tok.Next->isNot(tok::string_literal) &&
 1622         (Tok.Next->Tok.isLiteral() ||
 1623          Tok.Next->isOneOf(tok::kw_sizeof, tok::kw_alignof)))
 1632         Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace, tok::greater);
 1644     for (const FormatToken *Token = Tok.MatchingParen->Next; Token != &Tok;
 1645          Token = Token->Next)
 1651     if (Tok.Next->isOneOf(tok::identifier, tok::kw_this))
 1654     if (!Tok.Next->Next)
 1654     if (!Tok.Next->Next)
 1661         Tok.Next->isUnaryOperator() || Tok.Next->isOneOf(tok::amp, tok::star);
 1661         Tok.Next->isUnaryOperator() || Tok.Next->isOneOf(tok::amp, tok::star);
 1662     if (!NextIsUnary || Tok.Next->is(tok::plus) ||
 1663         !Tok.Next->Next->isOneOf(tok::identifier, tok::numeric_constant))
 1663         !Tok.Next->Next->isOneOf(tok::identifier, tok::numeric_constant))
 1987       Current = Current->Next;
 1991       Current = Current->Next;
 2008     for (const FormatToken *Tok = (*I)->First; Tok; Tok = Tok->Next) {
 2040   for (const auto *Tok = Line.First; Tok != nullptr; Tok = Tok->Next)
 2083     for (; Next; Next = Next->Next) {
 2090         if (Next->Next && Next->Next->is(tok::l_square) && Next->Next->Next &&
 2090         if (Next->Next && Next->Next->is(tok::l_square) && Next->Next->Next &&
 2090         if (Next->Next && Next->Next->is(tok::l_square) && Next->Next->Next &&
 2090         if (Next->Next && Next->Next->is(tok::l_square) && Next->Next->Next &&
 2091             Next->Next->Next->is(tok::r_square))
 2091             Next->Next->Next->is(tok::r_square))
 2092           Next = Next->Next->Next;
 2092           Next = Next->Next->Next;
 2102   const FormatToken *Next = Current.Next;
 2110     for (; Next; Next = Next->Next) {
 2114         Next = Next->Next;
 2118           Next = skipOperatorName(Next->Next);
 2137   if (Next->Next == Next->MatchingParen)
 2140   if (Next->MatchingParen->Next &&
 2141       Next->MatchingParen->Next->is(TT_PointerOrReference))
 2143   for (const FormatToken *Tok = Next->Next; Tok && Tok != Next->MatchingParen;
 2144        Tok = Tok->Next) {
 2192   FormatToken *Current = Line.First->Next;
 2276     Current = Current->Next;
 2281   for (Current = Line.First; Current != nullptr; Current = Current->Next) {
 2342   if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
 2342   if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
 2414       (!Right.Next || Right.Next->isNot(tok::l_paren))) {
 2414       (!Right.Next || Right.Next->isNot(tok::l_paren))) {
 2538                                 Right.MatchingParen->Next &&
 2539                                 Right.MatchingParen->Next->is(tok::colon);
 2704       (!Right.Next || Right.Next->is(tok::semi)))
 2704       (!Right.Next || Right.Next->is(tok::semi)))
 2964   if (Right.Next && Right.Next->is(TT_StructuredBindingLSquare) &&
 2964   if (Right.Next && Right.Next->is(TT_StructuredBindingLSquare) &&
 3031     if (Right.is(tok::plus) && Left.is(tok::string_literal) && Right.Next &&
 3032         Right.Next->is(tok::string_literal))
 3073   if (Right.is(tok::lessless) && Right.Next &&
 3075       Right.Next->is(tok::string_literal))
 3120     if (Left.MatchingParen && Left.MatchingParen->Next &&
 3121         Left.MatchingParen->Next->isOneOf(tok::comma, tok::r_paren) &&
 3179       Right.is(TT_SelectorName) && !Right.is(tok::r_square) && Right.Next) {
 3188     FormatToken *LBrace = Right.Next;
 3190       LBrace = LBrace->Next;
 3192         LBrace = LBrace->Next;
 3194           LBrace = LBrace->Next;
 3208            (LBrace->Next && LBrace->Next->is(tok::r_brace)))) ||
 3208            (LBrace->Next && LBrace->Next->is(tok::r_brace)))) ||
 3358             (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName)));
 3358             (!Right.Next || Right.Next->isNot(TT_FunctionDeclarationName)));
 3429   if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next &&
 3430                                     Right.Next->is(TT_ObjCMethodExpr)))
 3486   if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
 3486   if (Right.is(tok::identifier) && Right.Next && Right.Next->is(TT_DictLiteral))
 3554     if (!Tok->Next)
 3556     Tok = Tok->Next;
tools/clang/lib/Format/TokenAnnotator.h
   59       Current->Next = I->Tok;
   61       Current = Current->Next;
   69     Last->Next = nullptr;
   80       Current = Current->Next;
tools/clang/lib/Format/UnwrappedLineFormatter.cpp
  102          RootToken.Next && RootToken.Next->is(tok::colon)))
  102          RootToken.Next && RootToken.Next->is(tok::colon)))
  311          (TheLine->First->is(tok::r_brace) && TheLine->First->Next &&
  312           TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) &&
  347         I[-1]->First->is(tok::at) && I[-1]->First->Next) {
  348       tok::ObjCKeywordKind kwId = I[-1]->First->Next->Tok.getObjCKeywordID();
  521         (Line.First->Next && Line.First->Next->is(tok::kw_else)))
  521         (Line.First->Next && Line.First->Next->is(tok::kw_else)))
  582         while (RecordTok->Next &&
  586           RecordTok = RecordTok->Next;
  607           Tok = Tok->Next;
  616         if (Tok->Next && Tok->Next->is(tok::kw_else))
  616         if (Tok->Next && Tok->Next->is(tok::kw_else))
  676     for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) {
  684     assert(!A.Last->Next);
  688     A.Last->Next = B.First;
  692     for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) {
  707   for (; Tok; Tok = Tok->Next) {
 1139         for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next)
 1163         for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next)
 1163         for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next)
 1193       (!RootToken.Next ||
 1194        (RootToken.Next->is(tok::semi) && !RootToken.Next->Next)) &&
 1194        (RootToken.Next->is(tok::semi) && !RootToken.Next->Next)) &&
 1194        (RootToken.Next->is(tok::semi) && !RootToken.Next->Next)) &&
tools/clang/lib/Format/UsingDeclarationsSorter.cpp
   90   const FormatToken *Tok = UsingTok->Next;
   93     Tok = Tok->Next;
   97     Tok = Tok->Next;
  103     Tok = Tok->Next;
  107     Tok = Tok->Next;
tools/clang/lib/Format/WhitespaceManager.cpp
  507     return Current->Next->SpacesRequiredBefore == SpacesRequiredBefore;
  596         for (FormatToken *Next = C.Tok->Next; Next; Next = Next->Next) {
  596         for (FormatToken *Next = C.Tok->Next; Next; Next = Next->Next) {