13 #ifndef LLVM_CLANG_LEX_TOKENLEXER_H
14 #define LLVM_CLANG_LEX_TOKENLEXER_H
17 #include "llvm/ADT/ArrayRef.h"
25 class VAOptExpansionContext;
68 unsigned MacroStartSLocOffset;
74 unsigned MacroDefLength;
78 bool AtStartOfLine : 1;
79 bool HasLeadingSpace : 1;
87 bool NextTokGetsSpace : 1;
97 bool DisableMacroExpansion : 1;
110 : PP(pp), OwnsTokens(
false) {
111 Init(Tok, ILEnd, MI, ActualArgs);
119 : PP(pp), OwnsTokens(
false) {
120 Init(TokArray, NumToks, DisableExpansion, ownsTokens, isReinject);
139 void Init(
const Token *TokArray,
unsigned NumToks,
bool DisableMacroExpansion,
140 bool OwnsTokens,
bool IsReinject);
159 bool isAtEnd()
const {
160 return CurTokenIdx == NumTokens;
184 bool pasteTokens(Token &LHSTok, ArrayRef<Token> TokenStream,
185 unsigned int &CurIdx);
189 bool pasteTokens(Token &Tok);
205 void stringifyVAOPTContents(SmallVectorImpl<Token> &ResultToks,
206 const VAOptExpansionContext &VCtx,
207 SourceLocation VAOPTClosingParenLoc);
211 void ExpandFunctionArguments();
218 void HandleMicrosoftCommentPaste(Token &Tok, SourceLocation OpLoc);
223 SourceLocation getExpansionLocForMacroDefLoc(SourceLocation loc)
const;
230 void updateLocForMacroArgTokens(SourceLocation ArgIdSpellLoc,
231 Token *begin_tokens, Token *end_tokens);
235 bool MaybeRemoveCommaBeforeVaArgs(SmallVectorImpl<Token> &ResultToks,
236 bool HasPasteOperator,
237 MacroInfo *Macro,
unsigned MacroArgNo,
240 void PropagateLineStartLeadingSpaceInfo(Token &Result);
245 #endif // LLVM_CLANG_LEX_TOKENLEXER_H