Lines Matching refs:Lex
46 Lexer Lex(SM.getMainFileID(), SM.getBufferOrFake(SM.getMainFileID()), SM, in getOffsetAfterTokenSequence() local
50 Lex.LexFromRawLexer(Tok); in getOffsetAfterTokenSequence()
51 return GetOffsetAfterSequence(SM, Lex, Tok); in getOffsetAfterTokenSequence()
59 Lexer &Lex, StringRef Name, Token &Tok, in checkAndConsumeDirectiveWithName() argument
61 bool Matched = Tok.is(tok::hash) && !Lex.LexFromRawLexer(Tok) && in checkAndConsumeDirectiveWithName()
63 Tok.getRawIdentifier() == Name && !Lex.LexFromRawLexer(Tok) && in checkAndConsumeDirectiveWithName()
67 Lex.LexFromRawLexer(Tok); in checkAndConsumeDirectiveWithName()
71 void skipComments(Lexer &Lex, Token &Tok) { in skipComments() argument
73 if (Lex.LexFromRawLexer(Tok)) in skipComments()
87 [&](std::function<unsigned(const SourceManager &SM, Lexer &Lex, in getOffsetAfterHeaderGuardsAndComments()
92 [&Consume](const SourceManager &SM, Lexer &Lex, Token Tok) { in getOffsetAfterHeaderGuardsAndComments() argument
93 skipComments(Lex, Tok); in getOffsetAfterHeaderGuardsAndComments()
95 return std::max(InitialOffset, Consume(SM, Lex, Tok)); in getOffsetAfterHeaderGuardsAndComments()
101 [](const SourceManager &SM, Lexer &Lex, Token Tok) -> unsigned { in getOffsetAfterHeaderGuardsAndComments() argument
102 if (checkAndConsumeDirectiveWithName(Lex, "ifndef", Tok)) { in getOffsetAfterHeaderGuardsAndComments()
103 skipComments(Lex, Tok); in getOffsetAfterHeaderGuardsAndComments()
104 if (checkAndConsumeDirectiveWithName(Lex, "define", Tok) && in getOffsetAfterHeaderGuardsAndComments()
112 [](const SourceManager &SM, Lexer &Lex, Token Tok) -> unsigned { in getOffsetAfterHeaderGuardsAndComments() argument
113 if (checkAndConsumeDirectiveWithName(Lex, "pragma", Tok, in getOffsetAfterHeaderGuardsAndComments()
124 bool checkAndConsumeInclusiveDirective(Lexer &Lex, Token &Tok) { in checkAndConsumeInclusiveDirective() argument
126 Lex.LexFromRawLexer(Tok); in checkAndConsumeInclusiveDirective()
129 if (Tok.is(tok::hash) && !Lex.LexFromRawLexer(Tok) && in checkAndConsumeInclusiveDirective()
131 if (Lex.LexFromRawLexer(Tok)) in checkAndConsumeInclusiveDirective()
136 while (!Lex.LexFromRawLexer(Tok) && Tok.isNot(tok::greater)) { in checkAndConsumeInclusiveDirective()
162 [](const SourceManager &SM, Lexer &Lex, Token Tok) { in getMaxHeaderInsertionOffset() argument
163 skipComments(Lex, Tok); in getMaxHeaderInsertionOffset()
165 while (checkAndConsumeInclusiveDirective(Lex, Tok)) in getMaxHeaderInsertionOffset()