From 410306bf6ed906af77978caa199e5d96376bae66 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 12 Dec 2016 02:53:20 +0000 Subject: Add two new AST nodes to represent initialization of an array in terms of initialization of each array element: * ArrayInitLoopExpr is a prvalue of array type with two subexpressions: a common expression (an OpaqueValueExpr) that represents the up-front computation of the source of the initialization, and a subexpression representing a per-element initializer * ArrayInitIndexExpr is a prvalue of type size_t representing the current position in the loop This will be used to replace the creation of explicit index variables in lambda capture of arrays and copy/move construction of classes with array elements, and also C++17 structured bindings of arrays by value (which inexplicably allow copying an array by value, unlike all of C++'s other array declarations). No uses of these nodes are introduced by this change, however. llvm-svn: 289413 --- clang/lib/AST/Expr.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/AST/Expr.cpp') diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 776a7f996d0..0307648fa80 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -2899,6 +2899,7 @@ bool Expr::HasSideEffects(const ASTContext &Ctx, case UnaryExprOrTypeTraitExprClass: case AddrLabelExprClass: case GNUNullExprClass: + case ArrayInitIndexExprClass: case NoInitExprClass: case CXXBoolLiteralExprClass: case CXXNullPtrLiteralExprClass: @@ -2975,6 +2976,7 @@ bool Expr::HasSideEffects(const ASTContext &Ctx, case ExtVectorElementExprClass: case DesignatedInitExprClass: case DesignatedInitUpdateExprClass: + case ArrayInitLoopExprClass: case ParenListExprClass: case CXXPseudoDestructorExprClass: case CXXStdInitializerListExprClass: -- cgit v1.2.3