diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-06-12 22:31:48 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-06-12 22:31:48 +0000 |
commit | 7c3e615f01e8f9f587315800fdaf2305ed824568 (patch) | |
tree | 78d992b7e58f2d6d04e3e48cfebe807bb8eb705a /include/clang/Basic/StmtNodes.td | |
parent | a4bb99cd0055ba0e1f3107890e5b6cbe31e6d1cc (diff) | |
download | clang-7c3e615f01e8f9f587315800fdaf2305ed824568.tar.gz clang-7c3e615f01e8f9f587315800fdaf2305ed824568.tar.bz2 clang-7c3e615f01e8f9f587315800fdaf2305ed824568.tar.xz |
PR12086, PR15117
Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).
This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/StmtNodes.td')
-rw-r--r-- | include/clang/Basic/StmtNodes.td | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index cbfce83c4b..a9c6259405 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -110,6 +110,7 @@ def CXXThrowExpr : DStmt<Expr>; def CXXDefaultArgExpr : DStmt<Expr>; def CXXDefaultInitExpr : DStmt<Expr>; def CXXScalarValueInitExpr : DStmt<Expr>; +def CXXStdInitializerListExpr : DStmt<Expr>; def CXXNewExpr : DStmt<Expr>; def CXXDeleteExpr : DStmt<Expr>; def CXXPseudoDestructorExpr : DStmt<Expr>; |