File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -504,19 +504,13 @@ bool ByteCodeExprGen<Emitter>::VisitImplicitValueInitExpr(const ImplicitValueIni
504504 assert (AT);
505505 const auto *CAT = cast<ConstantArrayType>(AT);
506506 size_t NumElems = CAT->getSize ().getZExtValue ();
507+ PrimType ElemT = classifyPrim (CAT->getElementType ());
507508
508- if (std::optional<PrimType> ElemT = classify (CAT->getElementType ())) {
509- // TODO(perf): For int and bool types, we can probably just skip this
510- // since we memset our Block*s to 0 and so we have the desired value
511- // without this.
512- for (size_t I = 0 ; I != NumElems; ++I) {
513- if (!this ->visitZeroInitializer (*ElemT, CAT->getElementType (), E))
514- return false ;
515- if (!this ->emitInitElem (*ElemT, I, E))
516- return false ;
517- }
518- } else {
519- assert (false && " default initializer for non-primitive type" );
509+ for (size_t I = 0 ; I != NumElems; ++I) {
510+ if (!this ->visitZeroInitializer (ElemT, CAT->getElementType (), E))
511+ return false ;
512+ if (!this ->emitInitElem (ElemT, I, E))
513+ return false ;
520514 }
521515
522516 return true ;
You can’t perform that action at this time.
0 commit comments