clang 20.0.0git
|
An RAII class that tracks when the Preprocessor starts and stops lexing the definition of a (ISO C/C++) variadic macro. More...
#include "clang/Lex/VariadicMacroSupport.h"
Public Member Functions | |
VariadicMacroScopeGuard (const Preprocessor &P) | |
void | enterScope () |
Client code should call this function just before the Preprocessor is about to Lex tokens from the definition of a variadic (ISO C/C++) macro. | |
void | exitScope () |
Client code should call this function as soon as the Preprocessor has either completed lexing the macro's definition tokens, or an error occurred and the context is being exited. | |
~VariadicMacroScopeGuard () | |
An RAII class that tracks when the Preprocessor starts and stops lexing the definition of a (ISO C/C++) variadic macro.
As an example, this is useful for unpoisoning and repoisoning certain identifiers (such as VA_ARGS) that are only allowed in this context. Also, being a friend of the Preprocessor class allows it to access PP's cached identifiers directly (as opposed to performing a lookup each time).
Definition at line 30 of file VariadicMacroSupport.h.
|
inline |
Definition at line 36 of file VariadicMacroSupport.h.
References clang::IdentifierInfo::isPoisoned().
|
inline |
Definition at line 61 of file VariadicMacroSupport.h.
References exitScope().
|
inline |
Client code should call this function just before the Preprocessor is about to Lex tokens from the definition of a variadic (ISO C/C++) macro.
Definition at line 47 of file VariadicMacroSupport.h.
References clang::IdentifierInfo::setIsPoisoned().
|
inline |
Client code should call this function as soon as the Preprocessor has either completed lexing the macro's definition tokens, or an error occurred and the context is being exited.
This function is idempotent (might be explicitly called, and then reinvoked via the destructor).
Definition at line 56 of file VariadicMacroSupport.h.
References clang::IdentifierInfo::setIsPoisoned().
Referenced by ~VariadicMacroScopeGuard().