summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-02-17 08:42:25 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-02-17 08:42:25 +0000
commitc83ed8248e6cb010b132ed541d8e19ab70acbb2d (patch)
tree02e64b87df33d5f2f41f12a85d085dea0045cdec /clang/lib/CodeGen/CGDecl.cpp
parent8e7bfceb9896e9a241171ab96242ba5c7d5bbb33 (diff)
downloadbcm5719-llvm-c83ed8248e6cb010b132ed541d8e19ab70acbb2d.tar.gz
bcm5719-llvm-c83ed8248e6cb010b132ed541d8e19ab70acbb2d.zip
Basic code generation support for std::initializer_list.
We now generate temporary arrays to back std::initializer_list objects initialized with braces. The initializer_list is then made to point at the array. We support both ptr+size and start+end forms, although the latter is untested. Array lifetime is correct for temporary std::initializer_lists (e.g. call arguments) and local variables. It is untested for new expressions and member initializers. Things left to do: Massively increase the amount of testing. I need to write tests for start+end init lists, temporary objects created as a side effect of initializing init list objects, new expressions, member initialization, creation of temporary objects (e.g. std::vector) for initializer lists, and probably more. Get lifetime "right" for member initializers and new expressions. Not that either are very useful. Implement list-initialization of array new expressions. llvm-svn: 150803
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 2467d991d95..57425668ff7 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1093,6 +1093,7 @@ void CodeGenFunction::EmitExprAsInit(const Expr *init,
AggValueSlot::IsDestructed,
AggValueSlot::DoesNotNeedGCBarriers,
AggValueSlot::IsNotAliased));
+ MaybeEmitStdInitializerListCleanup(lvalue, init);
}
}
OpenPOWER on IntegriCloud