sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land.
Now I understand your idea about moving the logic to `tryEmitPrivateForMemory`. Indeed it is more general and consistent solution. Thank you. ================ Comment at: lib/CodeGen/CGExprConstant.cpp:643 + llvm::Constant *Filler) { + // Figre out how long the initial prefix of non-zero elements is. + unsigned NonzeroLength = ArrayBound; ---------------- s/Figre/Figure/ ? ================ Comment at: lib/CodeGen/CGExprConstant.cpp:903 SmallVector<llvm::Constant*, 16> Elts; - Elts.reserve(std::max(NumInitableElts, NumElements)); + if (fillC && fillC->isNullValue()) + Elts.reserve(NumInitableElts + 1); ---------------- The check for `fillC != nullptr` here is redundant, it was checked few lines above. ================ Comment at: test/CodeGenCXX/cxx11-initializer-aggregate.cpp:83 + struct S1 data_7[1024 * 1024 * 512] = {{0}}; + + // This variable must be initialized elementwise. ---------------- Array definitions: ``` char data_8[1000 * 1000 * 1000] = {}; int (&&data_9)[1000 * 1000 * 1000] = {0}; ``` also compile successfully with this patch and hang compiler without it. Repository: rC Clang https://reviews.llvm.org/D47166 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits