@@ -1254,45 +1254,6 @@ Address irgen::emitProjectValueInBuffer(IRGenFunction &IGF, SILType type,
1254
1254
return Address (addressOfValue, Alignment (1 ));
1255
1255
}
1256
1256
1257
- static llvm::Constant *getDeallocateValueInBufferFunction (IRGenModule &IGM) {
1258
-
1259
- llvm::Type *argTys[] = {IGM.TypeMetadataPtrTy , IGM.OpaquePtrTy };
1260
-
1261
- llvm::SmallString<40 > fnName (" __swift_deallocate_value_buffer" );
1262
-
1263
- return IGM.getOrCreateHelperFunction (
1264
- fnName, IGM.VoidTy , argTys,
1265
- [&](IRGenFunction &IGF) {
1266
- auto it = IGF.CurFn ->arg_begin ();
1267
- auto *metadata = &*(it++);
1268
- auto buffer = Address (&*(it++), Alignment (1 ));
1269
- auto &Builder = IGF.Builder ;
1270
-
1271
- // Dynamically check whether this type is inline or needs an allocation.
1272
- llvm::Value *isInline, *flags;
1273
- std::tie (isInline, flags) = emitLoadOfIsInline (IGF, metadata);
1274
- auto *outlineBB = IGF.createBasicBlock (" outline.deallocateValueInBuffer" );
1275
- auto *doneBB = IGF.createBasicBlock (" done" );
1276
-
1277
- Builder.CreateCondBr (isInline, doneBB, outlineBB);
1278
-
1279
- Builder.emitBlock (outlineBB);
1280
- {
1281
- auto *size = emitLoadOfSize (IGF, metadata);
1282
- auto *alignMask = emitAlignMaskFromFlags (IGF, flags);
1283
- auto *ptr = Builder.CreateLoad (Address (
1284
- Builder.CreateBitCast (buffer.getAddress (), IGM.Int8PtrPtrTy ),
1285
- buffer.getAlignment ()));
1286
- IGF.emitDeallocRawCall (ptr, size, alignMask);
1287
- Builder.CreateBr (doneBB);
1288
- }
1289
-
1290
- Builder.emitBlock (doneBB);
1291
- Builder.CreateRetVoid ();
1292
- },
1293
- true /* noinline*/ );
1294
- }
1295
-
1296
1257
llvm::Value *
1297
1258
irgen::emitGetEnumTagSinglePayloadGenericCall (IRGenFunction &IGF,
1298
1259
SILType payloadType,
0 commit comments