]> granicus.if.org Git - clang/commit
CodeGen support for global variables of type std::initializer_list<X>.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Sat, 25 Feb 2012 20:51:20 +0000 (20:51 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Sat, 25 Feb 2012 20:51:20 +0000 (20:51 +0000)
commit19b1a6eb2c90fab7cefe74bea5b6de490b65ac9d
tree1a0f6ea234bd4d6a3d4e8a523d0aad37d967ebba
parentbabcf9d04f4ed9d7ac96812e42c9e8fc0f1ae2c2
CodeGen support for global variables of type std::initializer_list<X>.

This emits a backing array with internal linkage and fills it with data,
then has the initializer_list point at the array. Dynamic initialization
and global destructors are correctly supported.

What doesn't work is nested initializer_lists. I have no idea how to
get them to work, either. However, these should be very rare, and so
I'll just call it a known bug and declare generalized initializers
DONE!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151457 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist-startend.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp