virtual void MacroUndefined(const Token &MacroNameTok, const MacroInfo *MI) {
}
+ /// Defined - This hook is called whenever the 'defined' operator is seen.
+ virtual void Defined(const Token &MacroNameTok) {
+ }
+
/// SourceRangeSkipped - This hook is called when a source range is skipped.
/// \param Range The SourceRange that was skipped. The range begins at the
/// #if/#else directive and ends after the #endif/#else directive.
Second->MacroUndefined(MacroNameTok, MI);
}
+ virtual void Defined(const Token &MacroNameTok) {
+ First->Defined(MacroNameTok);
+ Second->Defined(MacroNameTok);
+ }
+
virtual void SourceRangeSkipped(SourceRange Range) {
First->SourceRangeSkipped(Range);
Second->SourceRangeSkipped(Range);
PP.markMacroAsUsed(Macro);
}
+ // Invoke the 'defined' callback.
+ if (PPCallbacks *Callbacks = PP.getPPCallbacks())
+ Callbacks->Defined(PeekTok);
+
// If we are in parens, ensure we have a trailing ).
if (LParenLoc.isValid()) {
// Consume identifier.