clang 23.0.0git
clang::CXXExpansionStmtPattern Class Referencefinal

CXXExpansionStmtPattern - Represents an unexpanded C++ expansion statement. More...

#include "clang/AST/StmtCXX.h"

Inheritance diagram for clang::CXXExpansionStmtPattern:
[legend]

Public Types

enum class  ExpansionStmtKind : uint8_t { Enumerating , Iterating , Destructuring , Dependent }
Public Types inherited from clang::Stmt
enum  StmtClass { NoStmtClass = 0 }
enum  Likelihood { LH_Unlikely = -1 , LH_None , LH_Likely }
 The likelihood of a branch being taken. More...
using child_iterator = StmtIterator
 Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatements/subexpressions of an AST node.
using const_child_iterator = ConstStmtIterator
using child_range = llvm::iterator_range<child_iterator>
using const_child_range = llvm::iterator_range<const_child_iterator>

Public Member Functions

SourceLocation getLParenLoc () const
SourceLocation getColonLoc () const
SourceLocation getRParenLoc () const
SourceLocation getBeginLoc () const
SourceLocation getEndLoc () const
ExpansionStmtKind getKind () const
bool isDependent () const
bool isEnumerating () const
bool isIterating () const
bool isDestructuring () const
unsigned getNumSubStmts () const
CXXExpansionStmtDeclgetDecl ()
const CXXExpansionStmtDeclgetDecl () const
StmtgetInit ()
const StmtgetInit () const
void setInit (Stmt *S)
VarDeclgetExpansionVariable ()
const VarDeclgetExpansionVariable () const
DeclStmtgetExpansionVarStmt ()
const DeclStmtgetExpansionVarStmt () const
void setExpansionVarStmt (Stmt *S)
StmtgetBody ()
const StmtgetBody () const
void setBody (Stmt *S)
const DeclStmtgetRangeVarStmt () const
DeclStmtgetRangeVarStmt ()
void setRangeVarStmt (DeclStmt *S)
const VarDeclgetRangeVar () const
VarDeclgetRangeVar ()
const DeclStmtgetBeginVarStmt () const
DeclStmtgetBeginVarStmt ()
void setBeginVarStmt (DeclStmt *S)
const VarDeclgetBeginVar () const
VarDeclgetBeginVar ()
const DeclStmtgetIterVarStmt () const
DeclStmtgetIterVarStmt ()
void setIterVarStmt (DeclStmt *S)
const VarDeclgetIterVar () const
VarDeclgetIterVar ()
StmtgetDecompositionDeclStmt ()
const StmtgetDecompositionDeclStmt () const
void setDecompositionDeclStmt (Stmt *S)
DecompositionDeclgetDecompositionDecl ()
const DecompositionDeclgetDecompositionDecl () const
ExprgetExpansionInitializer ()
const ExprgetExpansionInitializer () const
void setExpansionInitializer (Expr *S)
child_range children ()
const_child_range children () const
Public Member Functions inherited from clang::Stmt
void * operator new (size_t bytes, const ASTContext &C, unsigned alignment=8)
void * operator new (size_t bytes, const ASTContext *C, unsigned alignment=8)
void * operator new (size_t bytes, void *mem) noexcept
void operator delete (void *, const ASTContext &, unsigned) noexcept
void operator delete (void *, const ASTContext *, unsigned) noexcept
void operator delete (void *, size_t) noexcept
void operator delete (void *, void *) noexcept
 Stmt ()=delete
 Stmt (const Stmt &)=delete
 Stmt (Stmt &&)=delete
Stmtoperator= (const Stmt &)=delete
Stmtoperator= (Stmt &&)=delete
 Stmt (StmtClass SC)
StmtClass getStmtClass () const
const char * getStmtClassName () const
SourceRange getSourceRange () const LLVM_READONLY
 SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager.
SourceLocation getBeginLoc () const LLVM_READONLY
SourceLocation getEndLoc () const LLVM_READONLY
void dump () const
 Dumps the specified AST fragment and all subtrees to llvm::errs().
void dump (raw_ostream &OS, const ASTContext &Context) const
int64_t getID (const ASTContext &Context) const
void dumpColor () const
 dumpColor - same as dump(), but forces color highlighting.
void dumpPretty (const ASTContext &Context) const
 dumpPretty/printPretty - These two methods do a "pretty print" of the AST back to its original source language syntax.
void printPretty (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
void printPrettyControlled (raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\n", const ASTContext *Context=nullptr) const
void printJson (raw_ostream &Out, PrinterHelper *Helper, const PrintingPolicy &Policy, bool AddQuotes) const
 Pretty-prints in JSON format.
void viewAST () const
 viewAST - Visualize an AST rooted at this Stmt* using GraphViz.
StmtIgnoreContainers (bool IgnoreCaptured=false)
 Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true.
const StmtIgnoreContainers (bool IgnoreCaptured=false) const
const StmtstripLabelLikeStatements () const
 Strip off all label-like statements.
StmtstripLabelLikeStatements ()
child_range children ()
const_child_range children () const
child_iterator child_begin ()
child_iterator child_end ()
const_child_iterator child_begin () const
const_child_iterator child_end () const
void Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
 Produce a unique representation of the given statement.
void ProcessODRHash (llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
 Calculate a unique representation for a statement that is stable across compiler invocations.

Static Public Member Functions

static CXXExpansionStmtPatternCreateEmpty (ASTContext &Context, EmptyShell Empty, ExpansionStmtKind Kind)
static CXXExpansionStmtPatternCreateDependent (ASTContext &Context, CXXExpansionStmtDecl *ESD, Stmt *Init, DeclStmt *ExpansionVar, Expr *ExpansionInitializer, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation RParenLoc)
 Create a dependent expansion statement pattern.
static CXXExpansionStmtPatternCreateDestructuring (ASTContext &Context, CXXExpansionStmtDecl *ESD, Stmt *Init, DeclStmt *ExpansionVar, Stmt *DecompositionDeclStmt, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation RParenLoc)
 Create a destructuring expansion statement pattern.
static CXXExpansionStmtPatternCreateEnumerating (ASTContext &Context, CXXExpansionStmtDecl *ESD, Stmt *Init, DeclStmt *ExpansionVar, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation RParenLoc)
 Create an enumerating expansion statement pattern.
static CXXExpansionStmtPatternCreateIterating (ASTContext &Context, CXXExpansionStmtDecl *ESD, Stmt *Init, DeclStmt *ExpansionVar, DeclStmt *Range, DeclStmt *Begin, DeclStmt *Iter, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation RParenLoc)
 Create an iterating expansion statement pattern.
static bool classof (const Stmt *T)
Static Public Member Functions inherited from clang::Stmt
static void addStmtClass (const StmtClass s)
static void EnableStatistics ()
static void PrintStats ()
static Likelihood getLikelihood (ArrayRef< const Attr * > Attrs)
static Likelihood getLikelihood (const Stmt *S)
static const AttrgetLikelihoodAttr (const Stmt *S)
static Likelihood getLikelihood (const Stmt *Then, const Stmt *Else)
static std::tuple< bool, const Attr *, const Attr * > determineLikelihoodConflict (const Stmt *Then, const Stmt *Else)

Friends

class ASTStmtReader

Additional Inherited Members

Protected Types inherited from clang::Stmt
enum  { NumExprBits = NumStmtBits + 5 + llvm::BitWidth<ExprDependence> }
enum  { NumCallExprBits = 25 }
enum  { NumOverloadExprBits = NumExprBits + 1 }
template<typename T>
using ConstCastIterator = CastIterator<T, const T *const, const Stmt *const>
 Const iterator for iterating over Stmt * arrays that contain only T *.
using ExprIterator = CastIterator<Expr>
using ConstExprIterator = ConstCastIterator<Expr>
Protected Member Functions inherited from clang::Stmt
void * operator new (size_t bytes) noexcept
void operator delete (void *data) noexcept
 Stmt (StmtClass SC, EmptyShell)
 Construct an empty statement.
Protected Attributes inherited from clang::Stmt
union { 
   StmtBitfields   StmtBits 
   NullStmtBitfields   NullStmtBits 
   CompoundStmtBitfields   CompoundStmtBits 
   LabelStmtBitfields   LabelStmtBits 
   AttributedStmtBitfields   AttributedStmtBits 
   IfStmtBitfields   IfStmtBits 
   SwitchStmtBitfields   SwitchStmtBits 
   WhileStmtBitfields   WhileStmtBits 
   DoStmtBitfields   DoStmtBits 
   ForStmtBitfields   ForStmtBits 
   GotoStmtBitfields   GotoStmtBits 
   LoopControlStmtBitfields   LoopControlStmtBits 
   ReturnStmtBitfields   ReturnStmtBits 
   SwitchCaseBitfields   SwitchCaseBits 
   DeferStmtBitfields   DeferStmtBits 
   ExprBitfields   ExprBits 
   ConstantExprBitfields   ConstantExprBits 
   PredefinedExprBitfields   PredefinedExprBits 
   DeclRefExprBitfields   DeclRefExprBits 
   FloatingLiteralBitfields   FloatingLiteralBits 
   StringLiteralBitfields   StringLiteralBits 
   CharacterLiteralBitfields   CharacterLiteralBits 
   UnaryOperatorBitfields   UnaryOperatorBits 
   UnaryExprOrTypeTraitExprBitfields   UnaryExprOrTypeTraitExprBits 
   ArrayOrMatrixSubscriptExprBitfields   ArrayOrMatrixSubscriptExprBits 
   CallExprBitfields   CallExprBits 
   MemberExprBitfields   MemberExprBits 
   CastExprBitfields   CastExprBits 
   BinaryOperatorBitfields   BinaryOperatorBits 
   InitListExprBitfields   InitListExprBits 
   ParenListExprBitfields   ParenListExprBits 
   GenericSelectionExprBitfields   GenericSelectionExprBits 
   PseudoObjectExprBitfields   PseudoObjectExprBits 
   SourceLocExprBitfields   SourceLocExprBits 
   ParenExprBitfields   ParenExprBits 
   ShuffleVectorExprBitfields   ShuffleVectorExprBits 
   StmtExprBitfields   StmtExprBits 
   ChooseExprBitfields   ChooseExprBits 
   CXXOperatorCallExprBitfields   CXXOperatorCallExprBits 
   CXXRewrittenBinaryOperatorBitfields   CXXRewrittenBinaryOperatorBits 
   CXXBoolLiteralExprBitfields   CXXBoolLiteralExprBits 
   CXXNullPtrLiteralExprBitfields   CXXNullPtrLiteralExprBits 
   CXXThisExprBitfields   CXXThisExprBits 
   CXXThrowExprBitfields   CXXThrowExprBits 
   CXXDefaultArgExprBitfields   CXXDefaultArgExprBits 
   CXXDefaultInitExprBitfields   CXXDefaultInitExprBits 
   CXXScalarValueInitExprBitfields   CXXScalarValueInitExprBits 
   CXXNewExprBitfields   CXXNewExprBits 
   CXXDeleteExprBitfields   CXXDeleteExprBits 
   TypeTraitExprBitfields   TypeTraitExprBits 
   DependentScopeDeclRefExprBitfields   DependentScopeDeclRefExprBits 
   CXXConstructExprBitfields   CXXConstructExprBits 
   ExprWithCleanupsBitfields   ExprWithCleanupsBits 
   CXXUnresolvedConstructExprBitfields   CXXUnresolvedConstructExprBits 
   CXXDependentScopeMemberExprBitfields   CXXDependentScopeMemberExprBits 
   OverloadExprBitfields   OverloadExprBits 
   UnresolvedLookupExprBitfields   UnresolvedLookupExprBits 
   UnresolvedMemberExprBitfields   UnresolvedMemberExprBits 
   CXXNoexceptExprBitfields   CXXNoexceptExprBits 
   SubstNonTypeTemplateParmExprBitfields   SubstNonTypeTemplateParmExprBits 
   LambdaExprBitfields   LambdaExprBits 
   RequiresExprBitfields   RequiresExprBits 
   ArrayTypeTraitExprBitfields   ArrayTypeTraitExprBits 
   ExpressionTraitExprBitfields   ExpressionTraitExprBits 
   CXXFoldExprBitfields   CXXFoldExprBits 
   PackIndexingExprBitfields   PackIndexingExprBits 
   CoawaitExprBitfields   CoawaitBits 
   ObjCObjectLiteralBitfields   ObjCObjectLiteralBits 
   ObjCIndirectCopyRestoreExprBitfields   ObjCIndirectCopyRestoreExprBits 
   OpaqueValueExprBitfields   OpaqueValueExprBits 
   ConvertVectorExprBitfields   ConvertVectorExprBits 
}; 

Detailed Description

CXXExpansionStmtPattern - Represents an unexpanded C++ expansion statement.

There are four kinds of expansion statements.

  1. Enumerating expansion statements.
  2. Iterating expansion statements.
  3. Destructuring expansion statements.
  4. Dependent expansion statements.
  1. An 'enumerating' expansion statement is one whose expansion-initializer is a brace-enclosed expression-list; this list is syntactically similar to an initializer list, but it isn't actually an expression in and of itself (in that it is never evaluated or emitted) and instead is just treated as a group of expressions. The expansion initializer of this is always a syntactic-form 'InitListExpr'.

Example:

///   template for (auto x : { 1, 2, 3 }) {
///     // ...
///   }
/// 

Note that the expression-list may also contain pack expansions, e.g. '{ 1, xs... }', in which case the expansion size is dependent.

Here, the '{ 1, 2, 3 }' is parsed as an 'InitListExpr'. This node handles storing (and pack-expanding) the individual expressions.

Sema then wraps this with a 'CXXExpansionSelectExpr', which also contains a reference to an integral NTTP that is used as the expansion index; this index is either dependent (if the expansion-size is dependent), or set to a value of I in the I-th expansion during the expansion process.

The actual expansion is done by 'BuildCXXExpansionSelectExpr()': for example, during the 2nd expansion of '{ a, b, c }', I is equal to 1, and BuildCXXExpansionSelectExpr(), when called via TreeTransform, 'instantiates' the expression '{ a, b, c }' to just 'b'.

  1. Represents an unexpanded iterating expansion statement.

An 'iterating' expansion statement is one whose expansion-initializer is a a range, i.e. it has a corresponding 'begin()'/'end()' pair that is determined based on a number of conditions as stated in [stmt.expand] and [stmt.ranged].

Specifically, let E denote the expansion-initializer; the expansion statement is iterating if the type of E is not an array type, and either

2a. 'E.begin' and 'E.end' exist (irrespective of whether they're accessible, deleted, or even callable), or

2b. ADL for 'begin(E)' and 'end(E)' finds at least one viable function.

If neither A nor B apply to E (or if E is an array type), we treat this as a destructuring expansion statement instead (see case 3 below).

Notably, case 2a only checks whether the 'begin' and 'end' members exist and does not perform proper overload resolution; this is because if there is a begin/end function, but it for some reason is not usable (e.g. because it is non-const but E is const), then we'd rather error and tell the user that their begin/end function is wrong rather than falling back to destructuring.

Conversely, case 2b does perform overload resolution, simply because ADL may find quite a few begin/end overloads for unrelated types that happen to be in the same namespace. E.g. if the type of E is 'std::tuple', then there are quite a few begin/end pairs in the namespace 'std', but non of them can actually be used for a 'std::tuple', and we definitely want to destructure a tuple rather than error about it not being iterable.

In either case, once we've decided that the expansion statement is indeed iterating, we do make sure that the expression 'E.begin()'/'begin(E)' is well-formed, but any error at that point is a hard error and does not make us switch to destructuring instead.

The result of this expression is stored in a variable 'begin', which is then used to compute another variable 'iter' (which is just 'begin' + the expansion index) during expansion. During the N-th expansion, the expansion variable is then set to '*iter'. See [stmt.expand] for more information.

The expression used to compute the size of the expansion is not stored and is only created at the moment of expansion. See Sema::ComputeExpansionSize() for more information about this.

Example:

///   static constexpr std::string_view foo = "abcd";
///   template for (auto x : foo) {
///     // ...
///   }
/// 

Here, 'begin' is 'foo.begin()', and during e.g. the 0-th expansion, 'iter' is 'begin + 0', and thus '*iter' yields 'a', which results in 'x' being a variable of type 'char' with value 'a'.

  1. Represents an unexpanded destructuring expansion statement.

A 'destructuring' expansion statement is any expansion statement that is not enumerating or iterating (i.e. destructuring is the last thing we try, and if it doesn't work, the program is ill-formed).

This essentially involves treating the expansion-initializer as the initializer of a structured-binding declaration, with the number of bindings and expansion size determined by the usual means (array size, std::tuple_size, etc.).

During the N-th expansion, the expansion variable is then initialized with the N-th binding of the structured-binding declaration. This is implemented by wrapping the initializer with a CXXExpansionSelectExpr, which selects a binding based on the current expansion index when called from TreeTransform.

Example:

///   std::tuple<int, long, unsigned> a {1, 2l, 3u};
///   template for (auto x : a) {
///     // ...
///   }
/// 

Here, we build 'auto [_U0, _U1, _U2] = a', and during e.g. the 0-th expansion, 'x' is initialized with '_U0'.

  1. Represents an expansion statement whose expansion-initializer is type-dependent.

This will eventually become an iterating or destructuring expansion statement once the expansion-initializer is no longer dependent.

Dependent expansion statements can never be enumerating: even if the expansion size of an enumerating expansion statement is dependent (which is possible if the expression-list contains a pack), we still don't build an 'Enumerating' 'CXXExpansionStmtPattern' for it.

Example:

///   template <typename T>
///   void f() {
///     template for (auto x : T()) {
///       // ...
///     }
///   }
/// 
See also
CXXExpansionStmtDecl for more documentation on expansion statements.

Definition at line 673 of file StmtCXX.h.

Member Enumeration Documentation

◆ ExpansionStmtKind

Enumerator
Enumerating 
Iterating 
Destructuring 
Dependent 

Definition at line 680 of file StmtCXX.h.

Member Function Documentation

◆ children() [1/2]

child_range clang::CXXExpansionStmtPattern::children ( )
inline

Definition at line 927 of file StmtCXX.h.

References getNumSubStmts().

◆ children() [2/2]

const_child_range clang::CXXExpansionStmtPattern::children ( ) const
inline

Definition at line 932 of file StmtCXX.h.

References getNumSubStmts().

◆ classof()

bool clang::CXXExpansionStmtPattern::classof ( const Stmt * T)
inlinestatic

Definition at line 937 of file StmtCXX.h.

References clang::Stmt::Stmt().

◆ CreateDependent()

CXXExpansionStmtPattern * CXXExpansionStmtPattern::CreateDependent ( ASTContext & Context,
CXXExpansionStmtDecl * ESD,
Stmt * Init,
DeclStmt * ExpansionVar,
Expr * ExpansionInitializer,
SourceLocation LParenLoc,
SourceLocation ColonLoc,
SourceLocation RParenLoc )
static

◆ CreateDestructuring()

CXXExpansionStmtPattern * CXXExpansionStmtPattern::CreateDestructuring ( ASTContext & Context,
CXXExpansionStmtDecl * ESD,
Stmt * Init,
DeclStmt * ExpansionVar,
Stmt * DecompositionDeclStmt,
SourceLocation LParenLoc,
SourceLocation ColonLoc,
SourceLocation RParenLoc )
static

◆ CreateEmpty()

CXXExpansionStmtPattern * CXXExpansionStmtPattern::CreateEmpty ( ASTContext & Context,
EmptyShell Empty,
ExpansionStmtKind Kind )
static

Definition at line 180 of file StmtCXX.cpp.

References clang::Empty.

◆ CreateEnumerating()

CXXExpansionStmtPattern * CXXExpansionStmtPattern::CreateEnumerating ( ASTContext & Context,
CXXExpansionStmtDecl * ESD,
Stmt * Init,
DeclStmt * ExpansionVar,
SourceLocation LParenLoc,
SourceLocation ColonLoc,
SourceLocation RParenLoc )
static

Create an enumerating expansion statement pattern.

Definition at line 185 of file StmtCXX.cpp.

References Enumerating, clang::Init, and clang::Stmt::Stmt().

Referenced by clang::Sema::BuildCXXEnumeratingExpansionStmtPattern(), and clang::ASTNodeImporter::VisitCXXExpansionStmtPattern().

◆ CreateIterating()

CXXExpansionStmtPattern * CXXExpansionStmtPattern::CreateIterating ( ASTContext & Context,
CXXExpansionStmtDecl * ESD,
Stmt * Init,
DeclStmt * ExpansionVar,
DeclStmt * Range,
DeclStmt * Begin,
DeclStmt * Iter,
SourceLocation LParenLoc,
SourceLocation ColonLoc,
SourceLocation RParenLoc )
static

◆ getBeginLoc()

SourceLocation CXXExpansionStmtPattern::getBeginLoc ( ) const

Definition at line 208 of file StmtCXX.cpp.

◆ getBeginVar() [1/2]

VarDecl * clang::CXXExpansionStmtPattern::getBeginVar ( )
inline

Definition at line 860 of file StmtCXX.h.

References clang::cast(), getBeginVarStmt(), and isIterating().

◆ getBeginVar() [2/2]

const VarDecl * clang::CXXExpansionStmtPattern::getBeginVar ( ) const
inline

Definition at line 855 of file StmtCXX.h.

References clang::cast(), getBeginVarStmt(), and isIterating().

◆ getBeginVarStmt() [1/2]

DeclStmt * clang::CXXExpansionStmtPattern::getBeginVarStmt ( )
inline

Definition at line 845 of file StmtCXX.h.

References clang::cast(), and isIterating().

◆ getBeginVarStmt() [2/2]

const DeclStmt * clang::CXXExpansionStmtPattern::getBeginVarStmt ( ) const
inline

◆ getBody() [1/2]

Stmt * clang::CXXExpansionStmtPattern::getBody ( )
inline

Definition at line 810 of file StmtCXX.h.

References clang::Stmt::Stmt().

Referenced by getEndLoc().

◆ getBody() [2/2]

const Stmt * clang::CXXExpansionStmtPattern::getBody ( ) const
inline

Definition at line 811 of file StmtCXX.h.

References clang::Stmt::Stmt().

◆ getColonLoc()

SourceLocation clang::CXXExpansionStmtPattern::getColonLoc ( ) const
inline

◆ getDecl() [1/2]

CXXExpansionStmtDecl * clang::CXXExpansionStmtPattern::getDecl ( )
inline

Definition at line 791 of file StmtCXX.h.

Referenced by clang::ASTNodeImporter::VisitCXXExpansionStmtPattern().

◆ getDecl() [2/2]

const CXXExpansionStmtDecl * clang::CXXExpansionStmtPattern::getDecl ( ) const
inline

Definition at line 792 of file StmtCXX.h.

◆ getDecompositionDecl() [1/2]

DecompositionDecl * CXXExpansionStmtPattern::getDecompositionDecl ( )

◆ getDecompositionDecl() [2/2]

const DecompositionDecl * clang::CXXExpansionStmtPattern::getDecompositionDecl ( ) const
inline

Definition at line 907 of file StmtCXX.h.

References getDecompositionDecl().

◆ getDecompositionDeclStmt() [1/2]

Stmt * clang::CXXExpansionStmtPattern::getDecompositionDeclStmt ( )
inline

◆ getDecompositionDeclStmt() [2/2]

const Stmt * clang::CXXExpansionStmtPattern::getDecompositionDeclStmt ( ) const
inline

Definition at line 896 of file StmtCXX.h.

References isDestructuring(), and clang::Stmt::Stmt().

◆ getEndLoc()

SourceLocation clang::CXXExpansionStmtPattern::getEndLoc ( ) const
inline

Definition at line 770 of file StmtCXX.h.

References getBody(), and clang::Stmt::getEndLoc().

◆ getExpansionInitializer() [1/2]

Expr * clang::CXXExpansionStmtPattern::getExpansionInitializer ( )
inline

Definition at line 912 of file StmtCXX.h.

References clang::cast(), and isDependent().

Referenced by clang::ASTNodeImporter::VisitCXXExpansionStmtPattern().

◆ getExpansionInitializer() [2/2]

const Expr * clang::CXXExpansionStmtPattern::getExpansionInitializer ( ) const
inline

Definition at line 917 of file StmtCXX.h.

References clang::cast(), and isDependent().

◆ getExpansionVariable() [1/2]

VarDecl * CXXExpansionStmtPattern::getExpansionVariable ( )

◆ getExpansionVariable() [2/2]

const VarDecl * clang::CXXExpansionStmtPattern::getExpansionVariable ( ) const
inline

Definition at line 799 of file StmtCXX.h.

References getExpansionVariable().

◆ getExpansionVarStmt() [1/2]

DeclStmt * clang::CXXExpansionStmtPattern::getExpansionVarStmt ( )
inline

◆ getExpansionVarStmt() [2/2]

const DeclStmt * clang::CXXExpansionStmtPattern::getExpansionVarStmt ( ) const
inline

Definition at line 804 of file StmtCXX.h.

References clang::cast().

◆ getInit() [1/2]

Stmt * clang::CXXExpansionStmtPattern::getInit ( )
inline

Definition at line 794 of file StmtCXX.h.

References clang::Stmt::Stmt().

Referenced by clang::ASTNodeImporter::VisitCXXExpansionStmtPattern().

◆ getInit() [2/2]

const Stmt * clang::CXXExpansionStmtPattern::getInit ( ) const
inline

Definition at line 795 of file StmtCXX.h.

References clang::Stmt::Stmt().

◆ getIterVar() [1/2]

VarDecl * clang::CXXExpansionStmtPattern::getIterVar ( )
inline

Definition at line 885 of file StmtCXX.h.

References clang::cast(), getIterVarStmt(), and isIterating().

◆ getIterVar() [2/2]

const VarDecl * clang::CXXExpansionStmtPattern::getIterVar ( ) const
inline

Definition at line 880 of file StmtCXX.h.

References clang::cast(), getIterVarStmt(), and isIterating().

◆ getIterVarStmt() [1/2]

DeclStmt * clang::CXXExpansionStmtPattern::getIterVarStmt ( )
inline

Definition at line 870 of file StmtCXX.h.

References clang::cast(), and isIterating().

◆ getIterVarStmt() [2/2]

const DeclStmt * clang::CXXExpansionStmtPattern::getIterVarStmt ( ) const
inline

◆ getKind()

ExpansionStmtKind clang::CXXExpansionStmtPattern::getKind ( ) const
inline

◆ getLParenLoc()

SourceLocation clang::CXXExpansionStmtPattern::getLParenLoc ( ) const
inline

Definition at line 766 of file StmtCXX.h.

Referenced by clang::ASTNodeImporter::VisitCXXExpansionStmtPattern().

◆ getNumSubStmts()

unsigned clang::CXXExpansionStmtPattern::getNumSubStmts ( ) const
inline

Definition at line 788 of file StmtCXX.h.

References getNumSubStmts().

Referenced by children(), children(), and getNumSubStmts().

◆ getRangeVar() [1/2]

VarDecl * clang::CXXExpansionStmtPattern::getRangeVar ( )
inline

Definition at line 835 of file StmtCXX.h.

References clang::cast(), getRangeVarStmt(), and isIterating().

◆ getRangeVar() [2/2]

const VarDecl * clang::CXXExpansionStmtPattern::getRangeVar ( ) const
inline

Definition at line 830 of file StmtCXX.h.

References clang::cast(), getRangeVarStmt(), and isIterating().

◆ getRangeVarStmt() [1/2]

DeclStmt * clang::CXXExpansionStmtPattern::getRangeVarStmt ( )
inline

Definition at line 820 of file StmtCXX.h.

References clang::cast(), and isIterating().

◆ getRangeVarStmt() [2/2]

const DeclStmt * clang::CXXExpansionStmtPattern::getRangeVarStmt ( ) const
inline

◆ getRParenLoc()

SourceLocation clang::CXXExpansionStmtPattern::getRParenLoc ( ) const
inline

Definition at line 768 of file StmtCXX.h.

Referenced by clang::ASTNodeImporter::VisitCXXExpansionStmtPattern().

◆ isDependent()

bool clang::CXXExpansionStmtPattern::isDependent ( ) const
inline

Definition at line 775 of file StmtCXX.h.

References Dependent.

Referenced by getExpansionInitializer(), getExpansionInitializer(), and setExpansionInitializer().

◆ isDestructuring()

bool clang::CXXExpansionStmtPattern::isDestructuring ( ) const
inline

◆ isEnumerating()

bool clang::CXXExpansionStmtPattern::isEnumerating ( ) const
inline

Definition at line 778 of file StmtCXX.h.

References Enumerating.

Referenced by clang::Sema::ComputeExpansionSize().

◆ isIterating()

◆ setBeginVarStmt()

void clang::CXXExpansionStmtPattern::setBeginVarStmt ( DeclStmt * S)
inline

Definition at line 850 of file StmtCXX.h.

References isIterating().

Referenced by CreateIterating().

◆ setBody()

void clang::CXXExpansionStmtPattern::setBody ( Stmt * S)
inline

Definition at line 812 of file StmtCXX.h.

References clang::Stmt::Stmt().

◆ setDecompositionDeclStmt()

void clang::CXXExpansionStmtPattern::setDecompositionDeclStmt ( Stmt * S)
inline

Definition at line 901 of file StmtCXX.h.

References isDestructuring(), and clang::Stmt::Stmt().

Referenced by CreateDestructuring().

◆ setExpansionInitializer()

void clang::CXXExpansionStmtPattern::setExpansionInitializer ( Expr * S)
inline

Definition at line 922 of file StmtCXX.h.

References isDependent().

Referenced by CreateDependent().

◆ setExpansionVarStmt()

void clang::CXXExpansionStmtPattern::setExpansionVarStmt ( Stmt * S)
inline

Definition at line 808 of file StmtCXX.h.

References clang::Stmt::Stmt().

◆ setInit()

void clang::CXXExpansionStmtPattern::setInit ( Stmt * S)
inline

Definition at line 796 of file StmtCXX.h.

References clang::Stmt::Stmt().

◆ setIterVarStmt()

void clang::CXXExpansionStmtPattern::setIterVarStmt ( DeclStmt * S)
inline

Definition at line 875 of file StmtCXX.h.

References isIterating().

Referenced by CreateIterating().

◆ setRangeVarStmt()

void clang::CXXExpansionStmtPattern::setRangeVarStmt ( DeclStmt * S)
inline

Definition at line 825 of file StmtCXX.h.

References isIterating().

Referenced by CreateIterating().

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 676 of file StmtCXX.h.

References ASTStmtReader.

Referenced by ASTStmtReader.


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