]> granicus.if.org Git - clang/commit
PR12086, PR15117
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 12 Jun 2013 22:31:48 +0000 (22:31 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 12 Jun 2013 22:31:48 +0000 (22:31 +0000)
commit7c3e615f01e8f9f587315800fdaf2305ed824568
tree78d992b7e58f2d6d04e3e48cfebe807bb8eb705a
parenta4bb99cd0055ba0e1f3107890e5b6cbe31e6d1cc
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
38 files changed:
include/clang/AST/Expr.h
include/clang/AST/ExprCXX.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/AST/Stmt.h
include/clang/Basic/StmtNodes.td
include/clang/Serialization/ASTBitCodes.h
lib/AST/Expr.cpp
lib/AST/ExprClassification.cpp
lib/AST/ExprConstant.cpp
lib/AST/ItaniumMangle.cpp
lib/AST/StmtPrinter.cpp
lib/AST/StmtProfile.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprAgg.cpp
lib/CodeGen/CGExprCXX.cpp
lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaExceptionSpec.cpp
lib/Sema/SemaInit.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriter.cpp
lib/Serialization/ASTWriterStmt.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-pr12086.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
test/SemaCXX/constant-expression-cxx11.cpp
test/SemaCXX/constant-expression-cxx1y.cpp
test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
tools/libclang/CXCursor.cpp
tools/libclang/RecursiveASTVisitor.h