clang 20.0.0git
Public Member Functions | List of all members
clang::VAOptDefinitionContext Class Reference

A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a variadic macro definition. More...

#include "clang/Lex/VariadicMacroSupport.h"

Inheritance diagram for clang::VAOptDefinitionContext:
Inheritance graph
[legend]

Public Member Functions

 VAOptDefinitionContext (Preprocessor &PP)
 
bool isVAOptToken (const Token &T) const
 
bool isInVAOpt () const
 Returns true if we have seen the VA_OPT and '(' but before having seen the matching ')'.
 
void sawVAOptFollowedByOpeningParens (const SourceLocation LParenLoc)
 Call this function as soon as you see VA_OPT and '('.
 
SourceLocation getUnmatchedOpeningParenLoc () const
 
bool sawClosingParen ()
 Call this function each time an rparen is seen.
 
void sawOpeningParen (SourceLocation LParenLoc)
 Call this function each time an lparen is seen.
 
bool isAtTopLevel () const
 Are we at the top level within the VA_OPT?
 

Detailed Description

A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a variadic macro definition.

Definition at line 66 of file VariadicMacroSupport.h.

Constructor & Destructor Documentation

◆ VAOptDefinitionContext()

clang::VAOptDefinitionContext::VAOptDefinitionContext ( Preprocessor PP)
inline

Definition at line 74 of file VariadicMacroSupport.h.

Member Function Documentation

◆ getUnmatchedOpeningParenLoc()

SourceLocation clang::VAOptDefinitionContext::getUnmatchedOpeningParenLoc ( ) const
inline

Definition at line 92 of file VariadicMacroSupport.h.

References isInVAOpt().

◆ isAtTopLevel()

bool clang::VAOptDefinitionContext::isAtTopLevel ( ) const
inline

Are we at the top level within the VA_OPT?

Definition at line 113 of file VariadicMacroSupport.h.

Referenced by clang::VAOptExpansionContext::hasPlaceholderBeforeRParen().

◆ isInVAOpt()

bool clang::VAOptDefinitionContext::isInVAOpt ( ) const
inline

Returns true if we have seen the VA_OPT and '(' but before having seen the matching ')'.

Definition at line 83 of file VariadicMacroSupport.h.

Referenced by getUnmatchedOpeningParenLoc(), sawClosingParen(), sawOpeningParen(), and sawVAOptFollowedByOpeningParens().

◆ isVAOptToken()

bool clang::VAOptDefinitionContext::isVAOptToken ( const Token T) const
inline

Definition at line 77 of file VariadicMacroSupport.h.

References clang::T.

◆ sawClosingParen()

bool clang::VAOptDefinitionContext::sawClosingParen ( )
inline

Call this function each time an rparen is seen.

It returns true only if the rparen that was just seen was the eventual (non-nested) closing paren for VAOPT, and ejects us out of the VAOPT context.

Definition at line 100 of file VariadicMacroSupport.h.

References isInVAOpt().

◆ sawOpeningParen()

void clang::VAOptDefinitionContext::sawOpeningParen ( SourceLocation  LParenLoc)
inline

Call this function each time an lparen is seen.

Definition at line 107 of file VariadicMacroSupport.h.

References isInVAOpt().

◆ sawVAOptFollowedByOpeningParens()

void clang::VAOptDefinitionContext::sawVAOptFollowedByOpeningParens ( const SourceLocation  LParenLoc)
inline

Call this function as soon as you see VA_OPT and '('.

Definition at line 86 of file VariadicMacroSupport.h.

References isInVAOpt().

Referenced by clang::VAOptExpansionContext::sawVAOptFollowedByOpeningParens().


The documentation for this class was generated from the following file: