File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -3787,6 +3787,13 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
3787
3787
3788
3788
// If the error value is non-null, branch to the error destination.
3789
3789
auto hasError = Builder.CreateICmpNE (errorValue, nullError);
3790
+
3791
+ // Create a dummy use of 'errorValue' in the catch BB to workaround an
3792
+ // LLVM miscompile that ends up taking the wrong branch if there are no
3793
+ // uses of 'errorValue' in the catch block.
3794
+ // FIXME: Remove this when the following radar is fixed: rdar://116636601
3795
+ Builder.CreatePtrToInt (errorValue, IGM.IntPtrTy );
3796
+
3790
3797
Builder.CreateCondBr (hasError,
3791
3798
typedErrorLoadBB ? typedErrorLoadBB : errorDest.bb ,
3792
3799
normalDest.bb );
@@ -3806,12 +3813,6 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
3806
3813
} else {
3807
3814
Builder.emitBlock (typedErrorLoadBB);
3808
3815
3809
- // Create a dummy use of 'errorValue' in the catch BB to workaround an
3810
- // LLVM miscompile that ends up taking the wrong branch if there are no
3811
- // uses of 'errorValue' in the catch block.
3812
- // FIXME: Remove this when the following radar is fixed: rdar://116636601
3813
- Builder.CreatePtrToInt (errorValue, IGM.IntPtrTy );
3814
-
3815
3816
auto &ti = cast<LoadableTypeInfo>(IGM.getTypeInfo (errorType));
3816
3817
Explosion errorValue;
3817
3818
ti.loadAsTake (*this , getCalleeTypedErrorResultSlot (errorType), errorValue);
You can’t perform that action at this time.
0 commit comments