Lines Matching refs:Tok
49 Token Tok; in getOffsetAfterTokenSequence() local
51 Lex.LexFromRawLexer(Tok); in getOffsetAfterTokenSequence()
52 return GetOffsetAfterSequence(SM, Lex, Tok); in getOffsetAfterTokenSequence()
60 Lexer &Lex, StringRef Name, Token &Tok, in checkAndConsumeDirectiveWithName() argument
62 bool Matched = Tok.is(tok::hash) && !Lex.LexFromRawLexer(Tok) && in checkAndConsumeDirectiveWithName()
63 Tok.is(tok::raw_identifier) && in checkAndConsumeDirectiveWithName()
64 Tok.getRawIdentifier() == Name && !Lex.LexFromRawLexer(Tok) && in checkAndConsumeDirectiveWithName()
65 Tok.is(tok::raw_identifier) && in checkAndConsumeDirectiveWithName()
66 (!RawIDName || Tok.getRawIdentifier() == *RawIDName); in checkAndConsumeDirectiveWithName()
68 Lex.LexFromRawLexer(Tok); in checkAndConsumeDirectiveWithName()
72 void skipComments(Lexer &Lex, Token &Tok) { in skipComments() argument
73 while (Tok.is(tok::comment)) in skipComments()
74 if (Lex.LexFromRawLexer(Tok)) in skipComments()
89 Token Tok)> in getOffsetAfterHeaderGuardsAndComments()
93 [&Consume](const SourceManager &SM, Lexer &Lex, Token Tok) { in getOffsetAfterHeaderGuardsAndComments() argument
94 skipComments(Lex, Tok); in getOffsetAfterHeaderGuardsAndComments()
95 unsigned InitialOffset = SM.getFileOffset(Tok.getLocation()); in getOffsetAfterHeaderGuardsAndComments()
96 return std::max(InitialOffset, Consume(SM, Lex, Tok)); in getOffsetAfterHeaderGuardsAndComments()
102 [](const SourceManager &SM, Lexer &Lex, Token Tok) -> unsigned { in getOffsetAfterHeaderGuardsAndComments() argument
103 if (checkAndConsumeDirectiveWithName(Lex, "ifndef", Tok)) { in getOffsetAfterHeaderGuardsAndComments()
104 skipComments(Lex, Tok); in getOffsetAfterHeaderGuardsAndComments()
105 if (checkAndConsumeDirectiveWithName(Lex, "define", Tok) && in getOffsetAfterHeaderGuardsAndComments()
106 Tok.isAtStartOfLine()) in getOffsetAfterHeaderGuardsAndComments()
107 return SM.getFileOffset(Tok.getLocation()); in getOffsetAfterHeaderGuardsAndComments()
113 [](const SourceManager &SM, Lexer &Lex, Token Tok) -> unsigned { in getOffsetAfterHeaderGuardsAndComments() argument
114 if (checkAndConsumeDirectiveWithName(Lex, "pragma", Tok, in getOffsetAfterHeaderGuardsAndComments()
116 return SM.getFileOffset(Tok.getLocation()); in getOffsetAfterHeaderGuardsAndComments()
125 bool checkAndConsumeInclusiveDirective(Lexer &Lex, Token &Tok) { in checkAndConsumeInclusiveDirective() argument
127 Lex.LexFromRawLexer(Tok); in checkAndConsumeInclusiveDirective()
130 if (Tok.is(tok::hash) && !Lex.LexFromRawLexer(Tok) && in checkAndConsumeInclusiveDirective()
131 Tok.is(tok::raw_identifier) && Tok.getRawIdentifier() == "include") { in checkAndConsumeInclusiveDirective()
132 if (Lex.LexFromRawLexer(Tok)) in checkAndConsumeInclusiveDirective()
134 if (Tok.is(tok::string_literal)) in checkAndConsumeInclusiveDirective()
136 if (Tok.is(tok::less)) { in checkAndConsumeInclusiveDirective()
137 while (!Lex.LexFromRawLexer(Tok) && Tok.isNot(tok::greater)) { in checkAndConsumeInclusiveDirective()
139 if (Tok.is(tok::greater)) in checkAndConsumeInclusiveDirective()
163 [](const SourceManager &SM, Lexer &Lex, Token Tok) { in getMaxHeaderInsertionOffset() argument
164 skipComments(Lex, Tok); in getMaxHeaderInsertionOffset()
165 unsigned MaxOffset = SM.getFileOffset(Tok.getLocation()); in getMaxHeaderInsertionOffset()
166 while (checkAndConsumeInclusiveDirective(Lex, Tok)) in getMaxHeaderInsertionOffset()
167 MaxOffset = SM.getFileOffset(Tok.getLocation()); in getMaxHeaderInsertionOffset()