@@ -1193,19 +1193,30 @@ CIRGenTypes::arrangeCXXStructorDeclaration(GlobalDecl GD) {
1193
1193
1194
1194
CIRGenCXXABI::AddedStructorArgCounts AddedArgs =
1195
1195
TheCXXABI.buildStructorSignature (GD, argTypes);
1196
- (void )AddedArgs;
1197
- assert (paramInfos.empty () && " NYI" );
1196
+ if (!paramInfos.empty ()) {
1197
+ // Note: prefix implies after the first param.
1198
+ if (AddedArgs.Prefix )
1199
+ paramInfos.insert (paramInfos.begin () + 1 , AddedArgs.Prefix ,
1200
+ FunctionProtoType::ExtParameterInfo{});
1201
+ if (AddedArgs.Suffix )
1202
+ paramInfos.append (AddedArgs.Suffix ,
1203
+ FunctionProtoType::ExtParameterInfo{});
1204
+
1205
+ assert (false && " Please sent PR with a test and remove this" );
1206
+ }
1198
1207
1199
- assert (!MD-> isVariadic () && " Variadic fns NYI " );
1200
- RequiredArgs required = RequiredArgs::All;
1201
- ( void )required ;
1208
+ RequiredArgs required =
1209
+ (PassParams && MD-> isVariadic () ? RequiredArgs (argTypes. size ())
1210
+ : RequiredArgs::All) ;
1202
1211
1203
1212
FunctionType::ExtInfo extInfo = FTP->getExtInfo ();
1213
+ CanQualType resultType = TheCXXABI.HasThisReturn (GD) ? argTypes.front ()
1214
+ : TheCXXABI.hasMostDerivedReturn (GD)
1215
+ ? Context.VoidPtrTy
1216
+ : Context.VoidTy ;
1204
1217
1205
- assert (!TheCXXABI.HasThisReturn (GD) && " NYI" );
1206
-
1207
- CanQualType resultType = Context.VoidTy ;
1208
- (void )resultType;
1218
+ assert (!TheCXXABI.HasThisReturn (GD) &&
1219
+ " Please sent PR with a test and remove this" );
1209
1220
1210
1221
return arrangeCIRFunctionInfo (resultType, cir::FnInfoOpts::IsInstanceMethod,
1211
1222
argTypes, extInfo, paramInfos, required);
0 commit comments