@@ -2930,6 +2930,39 @@ bool ByteCodeExprGen<Emitter>::VisitObjCBoxedExpr(const ObjCBoxedExpr *E) {
2930
2930
return this ->delegate (E->getSubExpr ());
2931
2931
}
2932
2932
2933
+ template <class Emitter >
2934
+ bool ByteCodeExprGen<Emitter>::VisitCXXStdInitializerListExpr(
2935
+ const CXXStdInitializerListExpr *E) {
2936
+ const Expr *SubExpr = E->getSubExpr ();
2937
+ const ConstantArrayType *ArrayType =
2938
+ Ctx.getASTContext ().getAsConstantArrayType (SubExpr->getType ());
2939
+ const Record *R = getRecord (E->getType ());
2940
+ assert (Initializing);
2941
+ assert (SubExpr->isGLValue ());
2942
+
2943
+ if (!this ->visit (SubExpr))
2944
+ return false ;
2945
+ if (!this ->emitInitFieldPtr (R->getField (0u )->Offset , E))
2946
+ return false ;
2947
+
2948
+ PrimType SecondFieldT = classifyPrim (R->getField (1u )->Decl ->getType ());
2949
+ if (isIntegralType (SecondFieldT)) {
2950
+ if (!this ->emitConst (static_cast <APSInt>(ArrayType->getSize ()),
2951
+ SecondFieldT, E))
2952
+ return false ;
2953
+ return this ->emitInitField (SecondFieldT, R->getField (1u )->Offset , E);
2954
+ }
2955
+ assert (SecondFieldT == PT_Ptr);
2956
+
2957
+ if (!this ->emitGetFieldPtr (R->getField (0u )->Offset , E))
2958
+ return false ;
2959
+ if (!this ->emitConst (static_cast <APSInt>(ArrayType->getSize ()), PT_Uint64, E))
2960
+ return false ;
2961
+ if (!this ->emitArrayElemPtrPop (PT_Uint64, E))
2962
+ return false ;
2963
+ return this ->emitInitFieldPtr (R->getField (1u )->Offset , E);
2964
+ }
2965
+
2933
2966
template <class Emitter > bool ByteCodeExprGen<Emitter>::discard(const Expr *E) {
2934
2967
OptionScope<Emitter> Scope (this , /* NewDiscardResult=*/ true ,
2935
2968
/* NewInitializing=*/ false );
0 commit comments