@@ -4518,12 +4518,12 @@ void CallEmission::emitToUnmappedExplosionWithDirectTypedError(
4518
4518
for (unsigned i = 0 , e = structTy->getNumElements (); i < e; ++i) {
4519
4519
llvm::Value *elt = values[combined.errorValueMapping [i]];
4520
4520
auto *nativeTy = structTy->getElementType (i);
4521
- elt = convertForAsyncDirect (IGF, elt, nativeTy, /* forExtraction*/ true );
4521
+ elt = convertForDirectError (IGF, elt, nativeTy, /* forExtraction*/ true );
4522
4522
errorExplosion.add (elt);
4523
4523
}
4524
4524
} else {
4525
4525
auto *converted =
4526
- convertForAsyncDirect (IGF, values[combined.errorValueMapping [0 ]],
4526
+ convertForDirectError (IGF, values[combined.errorValueMapping [0 ]],
4527
4527
combined.combinedTy , /* forExtraction*/ true );
4528
4528
errorExplosion.add (converted);
4529
4529
}
@@ -4541,12 +4541,12 @@ void CallEmission::emitToUnmappedExplosionWithDirectTypedError(
4541
4541
dyn_cast<llvm::StructType>(nativeSchema.getExpandedType (IGF.IGM ))) {
4542
4542
for (unsigned i = 0 , e = structTy->getNumElements (); i < e; ++i) {
4543
4543
auto *nativeTy = structTy->getElementType (i);
4544
- auto *converted = convertForAsyncDirect (IGF, values[i], nativeTy,
4544
+ auto *converted = convertForDirectError (IGF, values[i], nativeTy,
4545
4545
/* forExtraction*/ true );
4546
4546
resultExplosion.add (converted);
4547
4547
}
4548
4548
} else {
4549
- auto *converted = convertForAsyncDirect (
4549
+ auto *converted = convertForDirectError (
4550
4550
IGF, values[0 ], combined.combinedTy , /* forExtraction*/ true );
4551
4551
resultExplosion.add (converted);
4552
4552
}
@@ -5414,7 +5414,7 @@ llvm::Value* IRGenFunction::coerceValue(llvm::Value *value, llvm::Type *toTy,
5414
5414
return loaded;
5415
5415
}
5416
5416
5417
- llvm::Value *irgen::convertForAsyncDirect (IRGenFunction &IGF,
5417
+ llvm::Value *irgen::convertForDirectError (IRGenFunction &IGF,
5418
5418
llvm::Value *value, llvm::Type *toTy,
5419
5419
bool forExtraction) {
5420
5420
auto &Builder = IGF.Builder ;
@@ -5424,12 +5424,9 @@ llvm::Value *irgen::convertForAsyncDirect(IRGenFunction &IGF,
5424
5424
if (toTy->isPointerTy ()) {
5425
5425
if (fromTy->isPointerTy ())
5426
5426
return Builder.CreateBitCast (value, toTy);
5427
- if (fromTy == IGF.IGM .IntPtrTy )
5428
- return Builder.CreateIntToPtr (value, toTy);
5427
+ return Builder.CreateIntToPtr (value, toTy);
5429
5428
} else if (fromTy->isPointerTy ()) {
5430
- if (toTy == IGF.IGM .IntPtrTy ) {
5431
- return Builder.CreatePtrToInt (value, toTy);
5432
- }
5429
+ return Builder.CreatePtrToInt (value, toTy);
5433
5430
}
5434
5431
5435
5432
if (forExtraction) {
@@ -5887,12 +5884,12 @@ void IRGenFunction::emitScalarReturn(SILType returnResultType,
5887
5884
for (unsigned i = 0 , e = native.size (); i != e; ++i) {
5888
5885
llvm::Value *elt = native.claimNext ();
5889
5886
auto *nativeTy = structTy->getElementType (i);
5890
- elt = convertForAsyncDirect (*this , elt, nativeTy,
5887
+ elt = convertForDirectError (*this , elt, nativeTy,
5891
5888
/* forExtraction*/ false );
5892
5889
nativeAgg = Builder.CreateInsertValue (nativeAgg, elt, i);
5893
5890
}
5894
5891
} else {
5895
- nativeAgg = convertForAsyncDirect (*this , native.claimNext (), combinedTy,
5892
+ nativeAgg = convertForDirectError (*this , native.claimNext (), combinedTy,
5896
5893
/* forExtraction*/ false );
5897
5894
}
5898
5895
}
@@ -6224,7 +6221,7 @@ void irgen::emitAsyncReturn(IRGenFunction &IGF, AsyncContextLayout &asyncLayout,
6224
6221
for (unsigned i = 0 , e = result.size (); i != e; ++i) {
6225
6222
llvm::Value *elt = result.claimNext ();
6226
6223
auto *nativeTy = structTy->getElementType (i);
6227
- elt = convertForAsyncDirect (IGF, elt, nativeTy,
6224
+ elt = convertForDirectError (IGF, elt, nativeTy,
6228
6225
/* forExtraction*/ false );
6229
6226
nativeAgg = IGF.Builder .CreateInsertValue (nativeAgg, elt, i);
6230
6227
}
@@ -6234,7 +6231,7 @@ void irgen::emitAsyncReturn(IRGenFunction &IGF, AsyncContextLayout &asyncLayout,
6234
6231
nativeResultsStorage.push_back (out.claimNext ());
6235
6232
}
6236
6233
} else {
6237
- auto *converted = convertForAsyncDirect (
6234
+ auto *converted = convertForDirectError (
6238
6235
IGF, result.claimNext (), combinedTy, /* forExtraction*/ false );
6239
6236
nativeResultsStorage.push_back (converted);
6240
6237
}
0 commit comments