Commit Graph

2 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis f8b1771677 Don't waste memory if the initializer expression is empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 18:53:55 +00:00
Argyrios Kyrtzidis 4423ac0282 For
double data[20000000] = {0};

we would blow out the memory by creating 20M Exprs to fill out the initializer.

To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.

Fixes rdar://9275920.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 00:27:41 +00:00