14 #ifndef LLVM_CLANG_LEX_MACROARGS_H
15 #define LLVM_CLANG_LEX_MACROARGS_H
19 #include "llvm/ADT/ArrayRef.h"
34 unsigned NumUnexpArgTokens;
46 std::vector<std::vector<Token> > PreExpArgTokens;
50 std::vector<Token> StringifiedArgs;
56 MacroArgs(
unsigned NumToks,
bool varargsElided)
57 : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
88 const std::vector<Token> &
bool isVarargsElidedUse() const
isVarargsElidedUse - Return true if this is a C99 style varargs macro invocation and there was no arg...
Token - This structure provides full information about a lexed token.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
const std::vector< Token > & getPreExpArgument(unsigned Arg, const MacroInfo *MI, Preprocessor &PP)
getPreExpArgument - Return the pre-expanded form of the specified argument.
void destroy(Preprocessor &PP)
destroy - Destroy and deallocate the memory for this object.
const Token * getUnexpArgument(unsigned Arg) const
getUnexpArgument - Return a pointer to the first token of the unexpanded token list for the specified...
const Token & getStringifiedArgument(unsigned ArgNo, Preprocessor &PP, SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd)
getStringifiedArgument - Compute, cache, and return the specified argument that has been 'stringified...
static Token StringifyArgument(const Token *ArgToks, Preprocessor &PP, bool Charify, SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd)
StringifyArgument - Implement C99 6.10.3.2p2, converting a sequence of tokens into the literal string...
MacroArgs - An instance of this class captures information about the formal arguments specified to a ...
unsigned getNumArguments() const
getNumArguments - Return the number of arguments passed into this macro invocation.
MacroArgs * deallocate()
deallocate - This should only be called by the Preprocessor when managing its freelist.
Encodes a location in the source.
bool ArgNeedsPreexpansion(const Token *ArgTok, Preprocessor &PP) const
ArgNeedsPreexpansion - If we can prove that the argument won't be affected by pre-expansion, return false.
static unsigned getArgLength(const Token *ArgPtr)
getArgLength - Given a pointer to an expanded or unexpanded argument, return the number of tokens...
Encapsulates the data about a macro definition (e.g.
static MacroArgs * create(const MacroInfo *MI, ArrayRef< Token > UnexpArgTokens, bool VarargsElided, Preprocessor &PP)
MacroArgs ctor function - Create a new MacroArgs object with the specified macro and argument info...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.