r183872 - PR12086, PR15117
sebastian.redl at getdesigned.at
Thu Jun 13 12:23:38 PDT 2013
On 13.06.2013, at 00:31, Richard Smith wrote:
> Author: rsmith
> Date: Wed Jun 12 17:31:48 2013
> New Revision: 183872
> URL: http://llvm.org/viewvc/llvm-project?rev=183872&view=rev
> 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.
Awesome! I remember what a pain it was trying to implement the IR for this stuff.
More information about the cfe-commits