diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-21 20:03:38 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-21 20:03:38 +0000 |
| commit | 446bcf2d4ad7018a6f254eba17471b5e8310e79a (patch) | |
| tree | 7453c8a398b2acf094dbcae4a009b03b8608b1ca /clang/lib/Sema | |
| parent | 5514afe6b2e7aef761600967d3ebe89295fdf690 (diff) | |
| download | bcm5719-llvm-446bcf2d4ad7018a6f254eba17471b5e8310e79a.tar.gz bcm5719-llvm-446bcf2d4ad7018a6f254eba17471b5e8310e79a.zip | |
Use the ArrayFiller to fill out "holes" in the array initializer due to designated initializers,
avoiding to create separate Exprs for each one.
llvm-svn: 129933
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 307db14b588..2acb482c41e 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -404,7 +404,12 @@ InitListChecker::FillInValueInitializations(const InitializedEntity &Entity, if (hadError) { // Do nothing } else if (Init < NumInits) { - ILE->setInit(Init, ElementInit.takeAs<Expr>()); + // For arrays, just set the expression used for value-initialization + // of the "holes" in the array. + if (ElementEntity.getKind() == InitializedEntity::EK_ArrayElement) + ILE->setArrayFiller(ElementInit.takeAs<Expr>()); + else + ILE->setInit(Init, ElementInit.takeAs<Expr>()); } else { // For arrays, just set the expression used for value-initialization // of the rest of elements and exit. |

