/// MacroArgs ctor function - This destroys the vector passed in.
MacroArgs *MacroArgs::create(const MacroInfo *MI,
const Token *UnexpArgTokens,
- unsigned NumToks, bool VarargsElided) {
+ unsigned NumToks, bool VarargsElided,
+ Preprocessor &PP) {
assert(MI->isFunctionLike() &&
"Can't have args for an object-like macro!");
/// destroy - Destroy and deallocate the memory for this object.
///
-void MacroArgs::destroy() {
+void MacroArgs::destroy(Preprocessor &PP) {
// Run the dtor to deallocate the vectors.
this->~MacroArgs();
// Release the memory for the object.
/// concatenated together, with 'EOF' markers at the end of each argument.
unsigned NumUnexpArgTokens;
+ /// VarargsElided - True if this is a C99 style varargs macro invocation and
+ /// there was no argument specified for the "..." argument. If the argument
+ /// was specified (even empty) or this isn't a C99 style varargs function, or
+ /// if in strict mode and the C99 varargs macro had only a ... argument, this
+ /// is false.
+ bool VarargsElided;
+
/// PreExpArgTokens - Pre-expanded tokens for arguments that need them. Empty
/// if not yet computed. This includes the EOF marker at the end of the
/// stream.
/// stringified form of an argument has not yet been computed, this is empty.
std::vector<Token> StringifiedArgs;
- /// VarargsElided - True if this is a C99 style varargs macro invocation and
- /// there was no argument specified for the "..." argument. If the argument
- /// was specified (even empty) or this isn't a C99 style varargs function, or
- /// if in strict mode and the C99 varargs macro had only a ... argument, this
- /// is false.
- bool VarargsElided;
-
MacroArgs(unsigned NumToks, bool varargsElided)
: NumUnexpArgTokens(NumToks), VarargsElided(varargsElided) {}
~MacroArgs() {}
/// macro and argument info.
static MacroArgs *create(const MacroInfo *MI,
const Token *UnexpArgTokens,
- unsigned NumArgTokens, bool VarargsElided);
+ unsigned NumArgTokens, bool VarargsElided,
+ Preprocessor &PP);
/// destroy - Destroy and deallocate the memory for this object.
///
- void destroy();
+ void destroy(Preprocessor &PP);
/// ArgNeedsPreexpansion - If we can prove that the argument won't be affected
/// by pre-expansion, return false. Otherwise, conservatively return true.
// expansion stack, only to take it right back off.
if (MI->getNumTokens() == 0) {
// No need for arg info.
- if (Args) Args->destroy();
+ if (Args) Args->destroy(*this);
// Ignore this macro use, just return the next token in the current
// buffer.
// "#define VAL 42".
// No need for arg info.
- if (Args) Args->destroy();
+ if (Args) Args->destroy(*this);
// Propagate the isAtStartOfLine/hasLeadingSpace markers of the macro
// identifier to the expanded token.
}
return MacroArgs::create(MI, ArgTokens.data(), ArgTokens.size(),
- isVarargsElided);
+ isVarargsElided, *this);
}
/// ComputeDATE_TIME - Compute the current time, enter it into the specified