13#ifndef LLVM_CLANG_LEX_MACROARGS_H
14#define LLVM_CLANG_LEX_MACROARGS_H
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/Support/TrailingObjects.h"
30 :
private llvm::TrailingObjects<MacroArgs, Token> {
32 friend TrailingObjects;
37 unsigned NumUnexpArgTokens;
49 std::vector<std::vector<Token> > PreExpArgTokens;
56 unsigned NumMacroArgs;
59 : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
60 ArgCache(
nullptr), NumMacroArgs(
MacroArgs) {}
90 const std::vector<Token> &
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
MacroArgs - An instance of this class captures information about the formal arguments specified to a ...
const Token * getUnexpArgument(unsigned Arg) const
getUnexpArgument - Return a pointer to the first token of the unexpanded token list for the specified...
MacroArgs * deallocate()
deallocate - This should only be called by the Preprocessor when managing its freelist.
const std::vector< Token > & getPreExpArgument(unsigned Arg, Preprocessor &PP)
getPreExpArgument - Return the pre-expanded form of the specified argument.
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.
static unsigned getArgLength(const Token *ArgPtr)
getArgLength - Given a pointer to an expanded or unexpanded argument, return the number of tokens,...
bool ArgNeedsPreexpansion(const Token *ArgTok, Preprocessor &PP) const
ArgNeedsPreexpansion - If we can prove that the argument won't be affected by pre-expansion,...
bool invokedWithVariadicArgument(const MacroInfo *const MI, Preprocessor &PP)
Returns true if the macro was defined with a variadic (ellipsis) parameter AND was invoked with at le...
unsigned getNumMacroArguments() const
getNumMacroArguments - Return the number of arguments the invoked macro expects.
bool isVarargsElidedUse() const
isVarargsElidedUse - Return true if this is a C99 style varargs macro invocation and there was no arg...
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...
void destroy(Preprocessor &PP)
destroy - Destroy and deallocate the memory for this object.
Encapsulates the data about a macro definition (e.g.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Encodes a location in the source.
Token - This structure provides full information about a lexed token.
The JSON file list parser is used to communicate input to InstallAPI.