diff --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp index bda9cf1500804..e9e20b222d5d3 100644 --- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp +++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp @@ -504,19 +504,13 @@ bool ByteCodeExprGen::VisitImplicitValueInitExpr(const ImplicitValueIni assert(AT); const auto *CAT = cast(AT); size_t NumElems = CAT->getSize().getZExtValue(); + PrimType ElemT = classifyPrim(CAT->getElementType()); - if (std::optional ElemT = classify(CAT->getElementType())) { - // TODO(perf): For int and bool types, we can probably just skip this - // since we memset our Block*s to 0 and so we have the desired value - // without this. - for (size_t I = 0; I != NumElems; ++I) { - if (!this->visitZeroInitializer(*ElemT, CAT->getElementType(), E)) - return false; - if (!this->emitInitElem(*ElemT, I, E)) - return false; - } - } else { - assert(false && "default initializer for non-primitive type"); + for (size_t I = 0; I != NumElems; ++I) { + if (!this->visitZeroInitializer(ElemT, CAT->getElementType(), E)) + return false; + if (!this->emitInitElem(ElemT, I, E)) + return false; } return true;