@@ -5499,20 +5499,19 @@ class BuiltinBitCastExpr final
54995499 }
55005500};
55015501
5502- // / Helper that selects an expression from an expansion init list depending
5502+ // / Helper that selects an expression from an InitListExpr depending
55035503// / on the current expansion index.
55045504// /
5505- // / \see CXXEnumeratingExpansionStmtPattern
5506- class CXXExpansionInitListSelectExpr : public Expr {
5505+ // / \see CXXExpansionStmtPattern
5506+ class CXXExpansionSelectExpr : public Expr {
55075507 friend class ASTStmtReader ;
55085508
55095509 enum SubExpr { RANGE, INDEX, COUNT };
55105510 Expr *SubExprs[COUNT];
55115511
55125512public:
5513- CXXExpansionInitListSelectExpr (EmptyShell Empty);
5514- CXXExpansionInitListSelectExpr (const ASTContext &C,
5515- InitListExpr *Range, Expr *Idx);
5513+ CXXExpansionSelectExpr (EmptyShell Empty);
5514+ CXXExpansionSelectExpr (const ASTContext &C, InitListExpr *Range, Expr *Idx);
55165515
55175516 InitListExpr *getRangeExpr () {
55185517 return cast<InitListExpr>(SubExprs[RANGE]);
@@ -5543,61 +5542,9 @@ class CXXExpansionInitListSelectExpr : public Expr {
55435542 }
55445543
55455544 static bool classof (const Stmt *T) {
5546- return T->getStmtClass () == CXXExpansionInitListSelectExprClass ;
5545+ return T->getStmtClass () == CXXExpansionSelectExprClass ;
55475546 }
55485547};
5549-
5550- // / This class serves the same purpose as CXXExpansionInitListSelectExpr, but
5551- // / for destructuring expansion statements; that is, instead of selecting among
5552- // / a list of expressions, it selects from a list of 'BindingDecl's.
5553- // /
5554- // / \see CXXEnumeratingExpansionStmtPattern
5555- // / \see CXXDestructuringExpansionStmtPattern
5556- class CXXDestructuringExpansionSelectExpr : public Expr {
5557- friend class ASTStmtReader ;
5558-
5559- DecompositionDecl *Decomposition;
5560- Expr *Index;
5561-
5562- public:
5563- CXXDestructuringExpansionSelectExpr (EmptyShell Empty);
5564- CXXDestructuringExpansionSelectExpr (const ASTContext &C,
5565- DecompositionDecl *Decomposition,
5566- Expr *Index);
5567-
5568- DecompositionDecl *getDecompositionDecl () {
5569- return cast<DecompositionDecl>(Decomposition);
5570- }
5571-
5572- const DecompositionDecl *getDecompositionDecl () const {
5573- return cast<DecompositionDecl>(Decomposition);
5574- }
5575-
5576- void setDecompositionDecl (DecompositionDecl *E) { Decomposition = E; }
5577-
5578- Expr *getIndexExpr () { return Index; }
5579- const Expr *getIndexExpr () const { return Index; }
5580- void setIndexExpr (Expr *E) { Index = E; }
5581-
5582- SourceLocation getBeginLoc () const { return Decomposition->getBeginLoc (); }
5583- SourceLocation getEndLoc () const { return Decomposition->getEndLoc (); }
5584-
5585- child_range children () {
5586- return child_range (reinterpret_cast <Stmt **>(&Index),
5587- reinterpret_cast <Stmt **>(&Index + 1 ));
5588- }
5589-
5590- const_child_range children () const {
5591- return const_child_range (
5592- reinterpret_cast <Stmt **>(const_cast <Expr **>(&Index)),
5593- reinterpret_cast <Stmt **>(const_cast <Expr **>(&Index + 1 )));
5594- }
5595-
5596- static bool classof (const Stmt *T) {
5597- return T->getStmtClass () == CXXDestructuringExpansionSelectExprClass;
5598- }
5599- };
5600-
56015548} // namespace clang
56025549
56035550#endif // LLVM_CLANG_AST_EXPRCXX_H
0 commit comments